IDistributionVault
Inherits: IERC6372, IStatefulERC712
Author: M^0 Labs
Functions
claim
Allows a caller to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
token
address
The address of the token being claimed.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
destination
address
The address the account where the claimed token will be sent.
Returns
claimed
uint256
The total amount of token claimed by account
.
claimBySig
Allows a signer to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
account
address
The purported address of the signing account.
token
address
The address of the token being claimed.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
destination
address
The address of the account where the claimed token will be sent.
deadline
uint256
The last timestamp at which the signature is still valid.
v
uint8
v of the signature.
r
bytes32
r of the signature.
s
bytes32
s of the signature.
Returns
claimed
uint256
The total amount of token claimed by account
.
claimBySig
Allows a signer to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
account
address
The purported address of the signing account.
token
address
The address of the token being claimed.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
destination
address
The address of the account where the claimed token will be sent.
deadline
uint256
The last timestamp at which the signature is still valid.
signature
bytes
A byte array signature.
Returns
claimed
uint256
The total amount of token claimed by account
.
distribute
Distributes the unaccounted balance of token
.
Parameters
token
address
The address of the token being distributed.
Returns
<none>
uint256
The total amount of additional tokens accounted in this distribution event.
CLAIM_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for the claimBySig function.
distributionOfAt
Returns the total amount of token
eligible for distribution to holder at the end of epoch epoch
.
Parameters
token
address
The address of some token.
epoch
uint256
The epoch number as a clock value.
Returns
<none>
uint256
The total amount of token eligible for distribution to holder at the end of the epoch.
getClaimable
Returns the amount of token
account
can claim between inclusive epochs startEpoch
and endEpoch
.
Parameters
token
address
The address of some token.
account
address
The address of some account.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
Returns
<none>
uint256
The amount of token that account
has yet to claim for these epochs, if any.
getClaimDigest
Returns the digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
account
address
The purported address of the signing account.
token
address
The address of the token being claimed.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
destination
address
The address the account where the claimed token will be sent.
nonce
uint256
The nonce of the account claiming the token.
deadline
uint256
The last timestamp at which the signature is still valid.
Returns
<none>
bytes32
The digest to be signed.
getDistributable
Returns the additional balance of token_
that is not yet distributed.
Parameters
token
address
The address of some token.
Returns
<none>
uint256
The total amount of token owned by the vault that is yet to be distributed.
hasClaimed
Returns whether account
has already claimed their token
distribution for epoch
.
Parameters
token
address
The address of some token.
epoch
uint256
The epoch number as a clock value.
account
address
The address of some account.
Returns
<none>
bool
Whether account
has already claimed token
rewards for epoch
.
name
Returns the name of the contract.
zeroToken
Returns the address of the Zero Token holders must have in order to be eligible for distributions.
Events
Claim
Emitted when account
claims token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
token
address
The address of the token being claimed.
account
address
The address of the account claiming the distribution.
startEpoch
uint256
The starting epoch number as a clock value.
endEpoch
uint256
The ending epoch number as a clock value.
amount
uint256
The total amount of token claimed by account
.
Distribution
Emitted when token
is distributed pro rata to all holders at epoch epoch
.
Parameters
token
address
The address of the token being distributed.
epoch
uint256
The epoch number as a clock value.
amount
uint256
The total amount of token being distributed.
Errors
InvalidDestinationAddress
Revert message when the destination address is address(0).
InvalidZeroTokenAddress
Revert message when the Zero Token address set at deployment is address(0).
NotPastTimepoint
Revert message when a query for past values is for a timepoint greater or equal to the current clock.
Parameters
timepoint
uint256
The timepoint being queried.
clock
uint256
The current timepoint.
StartEpochAfterEndEpoch
Revert message when the start epoch is greater than the end epoch.
TransferFailed
Revert message when a token transfer, from this contract, fails.