Facet #2: Referral system
constructor
initializeReferrals
function initializeReferrals(uint256 _allyFeeP, uint256 _startReferrerFeeP, uint256 _targetVolumeUsd) external
Parameters
updateAllyFeeP
function updateAllyFeeP(uint256 _value) external
Updates allyFeeP
Parameters
updateStartReferrerFeeP
function updateStartReferrerFeeP(uint256 _value) external
Updates startReferrerFeeP
Parameters
updateReferralsTargetVolumeUsd
function updateReferralsTargetVolumeUsd(uint256 _value) external
Updates targetVolumeUsd
Parameters
whitelistAllies
function whitelistAllies(address[] _allies) external
Whitelists ally addresses
Parameters
unwhitelistAllies
function unwhitelistAllies(address[] _allies) external
Unwhitelists ally addresses
Parameters
whitelistReferrers
function whitelistReferrers(address[] _referrers, address[] _allies) external
Whitelists referrer addresses
Parameters
unwhitelistReferrers
function unwhitelistReferrers(address[] _referrers) external
Unwhitelists referrer addresses
Parameters
registerPotentialReferrer
function registerPotentialReferrer(address _trader, address _referrer) external virtual
Registers potential referrer for trader (only works if trader wasn't referred yet by someone else)
Parameters
distributeReferralReward
function distributeReferralReward(address _trader, uint256 _volumeUsd, uint256 _referrerFeeUsd, uint256 _gnsPriceUsd) external virtual
Distributes ally and referrer rewards
Parameters
claimAllyRewards
function claimAllyRewards() external
Claims pending GNS ally rewards of caller
claimReferrerRewards
function claimReferrerRewards() external
Claims pending GNS referrer rewards of caller
getReferrerFeeProgressP
function getReferrerFeeProgressP(address _referrer) external view returns (uint256)
Returns referrer fee % progress towards earning 100% based on his volume referred (1e10)
Parameters
getTraderLastReferrer
function getTraderLastReferrer(address _trader) external view returns (address)
Returns last referrer of trader (whether referrer active or not)
Parameters
getTraderActiveReferrer
function getTraderActiveReferrer(address _trader) external view returns (address)
Returns active referrer of trader
Parameters
getReferrersReferred
function getReferrersReferred(address _ally) external view returns (address[])
Returns referrers referred by ally
Parameters
getTradersReferred
function getTradersReferred(address _referrer) external view returns (address[])
Returns traders referred by referrer
Parameters
getReferralsAllyFeeP
function getReferralsAllyFeeP() external view returns (uint256)
Returns ally fee % of total referral fee
getReferralsStartReferrerFeeP
function getReferralsStartReferrerFeeP() external view returns (uint256)
Returns start referrer fee % of total referral fee when zero volume was referred
getReferralsTargetVolumeUsd
function getReferralsTargetVolumeUsd() external view returns (uint256)
Returns target volume in usd to reach 100% of referral fee
getAllyDetails
function getAllyDetails(address _ally) external view returns (struct IReferrals.AllyDetails)
Returns ally details
Parameters
getReferrerDetails
function getReferrerDetails(address _referrer) external view returns (struct IReferrals.ReferrerDetails)
Returns referrer details
Parameters