FOS LogoFOS Documentation
Technical Docs

Referral Contract

Registration, upgrades, basis-point splits, and deferred ETH claims

Referral Contract

Referral manages registered wallets and independent paid plans on Robinhood Chain. It does not mint FOSNFT collectibles, select recipients, or calculate their allocations.

Initial rates

Referrer's active planShare of a direct referral's paymentAdmin share
$2 plan50%50%
$5 plan60%40%
$10 plan82%18%

The referrer's own active plan at payment time determines the split, for both registration and upgrades. The buyer's plan determines the payment amount, not the commission percentage. Without a referrer, 100% goes to the admin. Dollar labels are nominal plan names; exact payment is the configured ETH price.

Specified write interfaces

FunctionBehavior
register(address referrer, uint256 tier)Register once with tier 2/5/10 and exact configured ETH payment
upgrade(uint256 newTier)Upgrade 2→5, 2→10, or 5→10 for the current price difference
claim()Withdraw a referrer's deferred transfer balance
withdraw()Withdraw available admin funds without taking deferred user liabilities

The direct referrer must be registered, cannot be self, and cannot be changed after registration. Zero address means no referrer. A referred registration increments referralCount; the specification does not describe upgrades as new referral registrations.

State and reads

StateMeaning
isRegisteredWallet registration status
userTierWallet's current plan
referredByFixed direct referrer
referralCountDirect registrations referred
totalEarnedRecorded referral earnings
pendingWithdrawalsDeferred ETH owed to the wallet
tierPriceConfigured ETH price for each plan
tierReferrerBpsPlan's commission rate in basis points
adminWalletAdmin beneficiary

Useful reads are getUpgradeCost, getUserInfo, getReferralLink, and adminWithdrawable. The supplied summary does not provide their complete ABI types, so use the verified ABI rather than inventing return tuple layouts. Main specified events are Registered, Upgraded, and PaymentDeferred; event argument signatures are not supplied.

Accounting

cost = tierPrice[newTier] - tierPrice[oldTier]
refAmount = floor(payment * tierReferrerBps[userTier[directReferrer]] / 10000)
adminAmount = payment - refAmount

Without a direct referrer, refAmount = 0. The referrer's active plan at payment time applies to registration and upgrade payments. Later plan changes never recalculate already processed payments. Admin funds must exclude pendingWithdrawals liabilities.

Authority and Verify integration

Owner controls include prices, percentages, admin wallet, and Verify connection. Prices must remain strictly ordered 2 < 5 < 10. When Verify is connected and Referral is an approved minter, initial registration issues a certificate with origin type 5, origin ID 0, and empty URI. Upgrade certificate issuance is not defined.

See public referral examples. Test ETH prices reported in the specification are not production prices. Validate exact amount enforcement, unauthorized reconfiguration, rejected receiver claims, and reentrancy before deployment.

On this page