Core Functions

distribute(token):amountdistribute(token): amount Allows anyone to distribute an undistributed balance of token (i.e. M, Cash, etc) to Zero holders pro rata to their respective balances at the end of the current epoch.

  • Gets current epoch

  • Stores delta between current balanceOf Vault and last stored balance per current epoch.

getClaimable(token,account,startEpoch,endEpoch):amountgetClaimable(token, account, startEpoch, endEpoch): amount Allows ZERO holders to claim their accumulated distributed token (i.e. M, Cash, etc) for an arbitrarily ordered array of previous epochs.

  • For each epoch from startEpochstartEpoch to endEpochendEpoch inclusives:

    • Checks if accountaccount has not claimed their distribution yet

    • Calculates pro-rata share of distributable tokentoken funds based on ZEROZERO balance of accountaccount at the end of epoch

  • Returns total claimable amount for all eligible epochs.

claim(token,account,startEpoch,endEpoch,destination):amountclaim(token, account, startEpoch, endEpoch, destination): amount Allows ZERO holders to claim their accumulated distributed token (i.e. M, Cash, etc) between a previous start and end epoch, inclusively.

  • For each epoch from startEpochstartEpoch to endEpochendEpoch inclusives:

    • Claims tokentoken funds, if not claimed yet, for msg.sendermsg.sender

    • Sets hasClaimedfor(token,epoch)=truehasClaimed for (token, epoch) = true

  • Transfers claimed amountamount of tokentoken to destinationdestination

  • Returns claimed amount.

Last updated

Copyright 2024 M^0 Foundation