JavReferrals
General Description
The JavReferrals contract used for manage a referral system, which incentivizes trading activities through rewards for allies (partners) and referrers. It supports the configuration of fees, reward structures, and ally/referrer whitelisting, while also enabling the distribution and claiming of rewards. Additionally, it provides getter functions to fetch detailed referral-related data.
Core Functionalities
initializeReferrals
initializeReferralsInitializes the referral system with specified parameters.
Parameters:
_allyFeeP: Fee percentage for allies._startReferrerFeeP: Initial fee percentage for referrers._openFeeP: Fee percentage for open trades._targetVolumeUsd: Target trading volume in USD for additional benefits.
Access Control:
reinitializer(2).
updateAllyFeeP
updateAllyFeePUpdates the ally fee percentage.
Parameters:
_value: New ally fee percentage.
Access Control:
onlyRole(Role.GOV).
updateStartReferrerFeeP
updateStartReferrerFeePUpdates the initial referrer fee percentage.
Parameters:
_value: New initial referrer fee percentage.
Access Control:
onlyRole(Role.GOV).
updateReferralsOpenFeeP
updateReferralsOpenFeePUpdates the open fee percentage for referrals.
Parameters:
_value: New open fee percentage.
Access Control:
onlyRole(Role.GOV).
updateReferralsTargetVolumeUsd
updateReferralsTargetVolumeUsdUpdates the target trading volume in USD.
Parameters:
_value: New target volume in USD.
Access Control:
onlyRole(Role.GOV).
whitelistAllies
whitelistAlliesAdds allies to the whitelist, enabling them to participate in the referral program.
Parameters:
_allies: Array of ally addresses to whitelist.
Access Control:
onlyRole(Role.GOV).
unwhitelistAllies
unwhitelistAlliesRemoves allies from the whitelist.
Parameters:
_allies: Array of ally addresses to remove from the whitelist.
Access Control:
onlyRole(Role.GOV).
whitelistReferrers
whitelistReferrersAdds referrers to the whitelist and associates them with specific allies.
Parameters:
_referrers: Array of referrer addresses._allies: Array of ally addresses corresponding to the referrers.
Access Control:
onlyRole(Role.GOV).
unwhitelistReferrers
unwhitelistReferrersRemoves referrers from the whitelist.
Parameters:
_referrers: Array of referrer addresses to remove.
Access Control:
onlyRole(Role.GOV).
registerPotentialReferrer
registerPotentialReferrerLinks a trader with a potential referrer.
Parameters:
_trader: Address of the trader._referrer: Address of the potential referrer.
Access Control:
onlySelf.
distributeReferralReward
distributeReferralRewardDistributes rewards based on a trader's activity and trading volume.
Parameters:
_trader: Address of the trader._volumeUsd: Trading volume in USD._pairOpenFeeP: Open fee percentage for the pair._javPriceUsd: Price of JAV token in USD.
Returns: Amount of reward distributed.
Access Control:
onlySelf.
claimAllyRewards
claimAllyRewardsAllows allies to claim their accrued rewards.
Access Control: Public.
claimReferrerRewards
claimReferrerRewardsAllows referrers to claim their accrued rewards.
Access Control: Public.
getReferrerFeeP
getReferrerFeePRetrieves the referrer fee percentage based on trading volume.
Parameters:
_pairOpenFeeP: Open fee percentage for the pair._volumeReferredUsd: Trading volume referred in USD.
Returns: Referrer fee percentage.
getTraderLastReferrer
getTraderLastReferrerRetrieves the last referrer associated with a trader.
Parameters:
_trader: Address of the trader.
Returns: Address of the last referrer.
getTraderActiveReferrer
getTraderActiveReferrerRetrieves the currently active referrer for a trader.
Parameters:
_trader: Address of the trader.
Returns: Address of the active referrer.
getReferrersReferred
getReferrersReferredRetrieves all referrers associated with a specific ally.
Parameters:
_ally: Address of the ally.
Returns: Array of referrer addresses.
getTradersReferred
getTradersReferredRetrieves all traders referred by a specific referrer.
Parameters:
_referrer: Address of the referrer.
Returns: Array of trader addresses.
getReferralsAllyFeeP
getReferralsAllyFeePRetrieves the current ally fee percentage.
Returns: Ally fee percentage.
getReferralsStartReferrerFeeP
getReferralsStartReferrerFeePRetrieves the current starting referrer fee percentage.
Returns: Starting referrer fee percentage.
getReferralsOpenFeeP
getReferralsOpenFeePRetrieves the current open fee percentage for referrals.
Returns: Open fee percentage.
getReferralsTargetVolumeUsd
getReferralsTargetVolumeUsdRetrieves the current target trading volume in USD.
Returns: Target volume in USD.
getAllyDetails
getAllyDetailsRetrieves detailed information about a specific ally.
Parameters:
_ally: Address of the ally.
Returns:
AllyDetailsstructure containing ally information.
getReferrerDetails
getReferrerDetailsRetrieves detailed information about a specific referrer.
Parameters:
_referrer: Address of the referrer.
Returns:
ReferrerDetailsstructure containing referrer information.
Last updated
Was this helpful?