Technical Docs
Referral Contract
Referral system and revenue split mechanics
Referral Contract
Processes a fixed deposit (nominally $10) and splits proceeds based on presence of a valid referral, sending 82% to referrer and 18% to admin. Without referral, 100% goes to admin.
State & Configuration
adminProtocol Distribution address (multi-sig),treasuryif distinct.referrerOf[code]mapping orisValidReferrer[address]; optionalcode → addressregistry.- Asset configuration: native vs
ERC-20token (address, decimals). Fixed price oracle not required since value is nominal and constant; alternatively reference USD-pegged stablecoin.
External Interfaces
payReferral(code)orpayReferral(referrer): validates referral; processes split; records accounting.withdraw()(pull-based): referrers and admin withdraw accrued balances to mitigate reentrancy risk.
Events
ReferralPaid(address payer, address referrer, uint256 refAmount, uint256 adminAmount),ReferralMissed(address payer, uint256 amount).
Accounting & Rounding
- Compute
refAmount = floor(amount * 82 / 100),adminAmount = amount - refAmountto avoid dust loss. - Track per-beneficiary accruals in mappings; transfers occur via withdraw to reduce attack surface.
- Admin routing: The 18% admin fee is routed directly to the Admin wallet.
- Legal Classification: Referral splits are technically defined as "Protocol Fee Rebates" or "Commission Splits," not wages or salary. The system generates no 1099/tax forms; users are solely responsible for local tax compliance.
Security
- Validate referral source (signed code by backend or on-chain registry) to prevent spoofing.
- Use
nonReentrantand CEI; never assumeERC-20returnstruewithout checking. - Program Rule: The referral program is linear and single-level. Only direct referrals count; there is no multi-level/MLM structure.
- Participation: Referral participation is optional and does not require NFT purchase.