Diamond Pattern (EIP-2535)
The core of the RWANFTFI system is implemented using the Diamond Pattern (EIP-2535). This architectural choice allows the protocol to bypass the standard smart contract size limit (24KB) by splitting functionality across multiple independent modules called “Facets” (smart contract modules accessed through a single proxy contract).Core Facets
AdminFacet
System parameters, roles, business sales, and special NFT minting.
MarketingFacet
User registration, NFT purchases, and marketing reward distribution.
FarmingFacet
NFTM mining and DA farming cycle management.
PaymentFacet
Deposits, withdrawals, Voucher creation, and accumulative transfers.
TreeFacet
22-level binary tree logic and user placement algorithms.
ResolverFacet
Expired DA stack processing, Voucher burns, and frozen account resolution.
ViewFacet
Read-only queries for user data, balances, and tree structures.
Upgradability Matrix
- Diamond Contract (EIP-2535): Upgradeable via Facet cuts — allows adding, replacing, or removing individual modules without redeploying the entire system.
- TokenReserve (DA): Upgradeable via Transparent Proxy — logic updates are possible without changing the contract address.
- NFTs (Regular, Gift, Ambassador), GovToken, AdminContract: Non-upgradeable — ensuring immutability of core assets and governance rules.
Role Management
The system utilizes a hierarchical role structure (AccessControlEnumerable) to manage permissions securely:ADMIN_ROLE: Can grant/revoke other roles and change critical system parameters.SERVICE_ROLE: Executed by backend scripts for automated tasks (e.g., resolving expired stacks, processing cross-chain deposits).SIGNER_ROLE: Used for cryptographic signature verification to authorize specific actions like Voucher transfers.MINTER_ROLE: Authorized to mint specific tokens or NFTs.
Balance Schema & Payment Priority
To manage the complex flow of funds, RWANFTFI employs a multi-tiered balance schema within the smart contract. User Balances:- Regular Balance (
balance): The primary wallet for available USDT. Funds here can be withdrawn at any time, used to purchase NFTs, or used to generate Vouchers. - Accumulative Balance (
accumulativeBalance): A mandatory savings account where 20% of each marketing reward is credited immediately upon accrual.- Usage: Can only be used to purchase the same level NFT or upgrade to a higher level.
- Fees: Using this balance for NFT purchases incurs a 20% fee. Transferring it to another user also incurs a 20% fee.
- 120-Day Redistribution: If the user does not use their Accumulative Balance within 120 days, the following mechanism is triggered:
- 70% of the unused balance is directed to the DA Liquidity Pool for minting new DA tokens, strengthening the token’s price backing.
- 30% is transferred to the user’s direct upline sponsor.
- If the upline sponsor’s Income Limit is exhausted (equals zero), the 30% passes further up to the next eligible participant in the structure.
- If no participant in the chain has an active Income Limit, the remaining 30% is also routed to the DA Liquidity Pool.
- Limit (
limit): Represents the maximum remaining income an NFT can generate.
System Balances
In addition to user balances, the smart contract maintains three internal system balances:- Dev Balance (
devBalance): Accumulates platform fees and commissions for operational funding. - Token Reserve Balance (
tokenReserveBalance): The USDT liquidity pool that 100% backs the DA token. Every income source in the ecosystem feeds into this pool. - Price Impact Balance (
priceImpactBalance): A special reserve used to manage DA token price stability during specific ecosystem events.
Payment Priority
When making a purchase, the smart contract deducts funds in this order:All transactions on the Binance Smart Chain require standard network gas fees paid in BNB. Users must hold a small amount of BNB in their wallet to execute any on-chain operations (purchases, withdrawals, transfers). This is separate from USDT balances used within the ecosystem.

