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

# ⚙️ Fee Contract

## FeeContract Overview

### 1. Overview

The `FeeContract` smart contract serves as the governance treasury and development fund within the Smart Global ecosystem. Deployed on the BNB Smart Chain, this contract manages the 2% fee allocation transferred from the network and central bank liquidity distribution functions.

The architecture of this treasury removes unilateral administrative authority over financial management. The contract contains no direct withdrawal functions for the founder or administrator. Assets retained within this fund—designated for infrastructure development, maintenance, and contract upgrades—are managed strictly through the resolutions of the Decentralized Autonomous Organization (DAO).

### 2. Governance Architecture & Asset Management

Incoming assets to this fund (USDT and native `SGT` tokens) are locked within contract storage. Their disbursement requires a voting mechanism managed by qualified network members. The asset management process is executed via a 4-stage operational cycle:

* Proposal Initiation (`startProposal`): The founder submits a proposal on the blockchain specifying the action type, destination address, and required volume. The system immediately queries and records a snapshot of eligible voters.
* Voting Participation (`vote`): Network members who have achieved a cumulative total of at least 300 binary points (300-point club) hold voting rights and can register their affirmative vote.
* Majority Threshold (`executeProposal`): For a resolution to become executable, the total affirmative votes must strictly exceed 50% of all 300-point club members recorded at the time of the snapshot.
* Automated Execution: Upon achieving the required threshold, any network member can invoke the execution function. The smart contract then automatically transfers the assets or upgrades the network address based on the proposal parameters.

### 3. Proposal Types & Fund Capabilities

Through the voting system, the 300-point club manages oversight across three specific operational parameters:

| **Proposal ID (pType)** | **Governance Resolution** | **Execution Logic**                                                                         |
| ----------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| Type 0                  | Transfer USDT             | Transfers a specified volume of USDT from the fund balance to a designated address.         |
| Type 1                  | Transfer Token            | Transfers a specified volume of `SGT` tokens from the fund balance to a designated address. |
| Type 2                  | Update Network            | Modifies and upgrades the linked payment gateway contract address (`globalPayAddress`).     |

### 4. Security Architecture & Protection Mechanisms

The `FeeContract` incorporates specific mechanisms to manage treasury assets and restrict administrative control:

* ReentrancyGuard: Applied to execution utilities and financial allocations to prevent reentrancy attacks.
* One-Time Connection Lock: Initial connections to the native token and payment contract are configured once by the founder. Subsequent modifications require a formal governance resolution (Type 2).
* No Admin Withdrawals: The contract code contains no functions for direct asset withdrawal by the owner (`onlyOwner`). Asset transfers require the 50% governance approval threshold.

### 5. Technical Documentation Guide

To detail the functions of the governance treasury, the documentation is organized into two primary sections:

* Admin Functions: Technical reference for the two configuration utilities establishing the initial fund connections to the native token and payment contract.
* DAO & Governance Functions: Logic, conditions, and mathematical parameters governing the four functions of the proposal cycle: initialization, snapshotting, voting, and resolution execution.
