registerEntity
transferEntityOwner
registerReferrer
requireApprovalsForReferrers
approveReferrer
removeReferrerRelationship
registerReferral
removeReferral
addRewards
setLockoutPeriod
withdrawRewards
registerIncentiveFunction
IDivviIncentiveFunction
contract.setIncentiveFunctionLockoutPeriod
registerRewardTransformFunction
IDivviRewardTransformFunction
contract.registerScalingRewardTransformFunction
setRewardTransformFunctionLockoutPeriod
setRewardTranslationFunction
IDivviRewardTranslationFunction
contract.setDirectRewardTranslationFunction
setRewardTranslationFunctionLockoutPeriod
setDistributionIncentiveFunction
distributeRewards
claimRewards
claimRewards
function. This method implements the recursion worked out in the previous section, using the appropriate functions that entities have registered with the protocol at each step of the recursion. At each “step” of the recursion (i.e., once per entity), the per-user revenue contribution values (i.e., as explained in the previous section) are published onchain in a well-known location, accessible by both the claimRewards
function as well as any custom functions that entities may have registered with the protocol.
In claimRewards
, directly after calculating the per-user revenue contributions, the method determines the total revenue that an entity owes to each of its upstream referrers, and transfers it to the RewardsManager
contract. Note that this revenue may come from an EntityRewards
contract in the case of incentive rewards, or from the RewardsManager
contract, in the case of Divvi rewards being propagated upstream. When claimRewards
has finished sending out upstream rewards from a particular entity, it marks that entity as being able to claim whatever other rewards it earned. Additionally, at the end of each recursion step, the claimRewards
function sends out distribution incentive rewards to the method caller.