> For the complete documentation index, see [llms.txt](https://forforest.gitbook.io/for/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://forforest.gitbook.io/for/for-en/technology/4.4-smart-contract-details.md).

# 4.4 Smart contract details

#### \[Finance] Technology for a Collective Wallet that directly links consumption to regeneration

A mechanism that automatically connects consumer activity to forest restoration is realized through the integration of custom contracts extended from the ERC-20 standard and a distribution contract.

1. **ERC3009:** In addition to standard ERC-20 transfers, it implements transferWithAuthorization(). This enables a third party to pay the gas fee and execute the transfer by using authorization data signed off-chain by the user, making gasless transfers and meta-transactions possible.
2. **Allowlist:** A function has been implemented in the smart contract that restricts which wallet addresses can exchange tokens using functions such as transfer and transferWithAuthorization. This is intended to prevent transactions between unspecified or unverified wallets.
3. **RouterContract:** A contract that can distribute tokens at predetermined ratios. Funds pooled here are distributed trustlessly according to preprogrammed proportions. These ratios can be updated dynamically based on the governance and EAS verification results described below.

#### \[Incentive] Technical policy on exchange scores that support sustainable care activities

To increase the velocity of money without reducing held assets, a "Reputation Decay Algorithm" is implemented at the code level.

1. **Transparent Rank Calculation:** Because updating the rank of all users every block is impractical from a gas-fee perspective, the calculation formula has been moved on-chain in addition to transactions, enabling transparent rank calculation.
2. **Decay Formula:** A user's rank score decays in accordance with the elapsed time from the last activity timestamp to the current timestamp. The decay coefficient, for example one that halves the rank after 30 days, is determined through community governance.
   * The score added by this transaction, weighted by the diversity of counterparties and the degree of participation in care activities.
3. **Tiered Benefits (Dynamic Incentives):** Based on the calculated score, the user's status is determined across five levels.

#### \[Communication] Technology for media functions that generate connection

To evolve currency from mere numerical data into a "medium that carries context," we implement a transaction structure integrated with the Ethereum Attestation Service (EAS).

1. **Attestation-linked Transfer:**&#x54;o inscribe the meaning of an action, its context, on-chain at the same time as the token transfer, we leverage EAS schemas.
   * **Schema Definition:** `uid: bytes32`, `actionType: string`, `message: string`, `location: string`
   * **Transaction Flow:** For example, when a user makes payment in the app by purchasing a "thinned-wood cup," the following two actions are executed atomically and inseparably in the background.
     1. **Payment:** Transfer of FoR tokens.
     2. **Attestation:** Issuance of an attestation certifying "who used it, where, and for what care purpose."
2. **Context Explorer:** Rather than showing only a transaction history (Tx Hash), this references the Attestation to display a "timeline of narratives." In this way, the circulation path of the currency is visualized as a chain of gratitude and care, encouraging behavioral change among users.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://forforest.gitbook.io/for/for-en/technology/4.4-smart-contract-details.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
