IDistributionVault
Inherits: IERC6372, IStatefulERC712
Author: M^0 Labs
Functions
claim
Allows a caller to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the token being claimed. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
|
| The address the account where the claimed token will be sent. |
Returns
Name | Type | Description |
---|---|---|
|
| The total amount of token claimed by |
claimBySig
Allows a signer to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| The purported address of the signing account. |
|
| The address of the token being claimed. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
|
| The address of the account where the claimed token will be sent. |
|
| The last timestamp at which the signature is still valid. |
|
| v of the signature. |
|
| r of the signature. |
|
| s of the signature. |
Returns
Name | Type | Description |
---|---|---|
|
| The total amount of token claimed by |
claimBySig
Allows a signer to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| The purported address of the signing account. |
|
| The address of the token being claimed. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
|
| The address of the account where the claimed token will be sent. |
|
| The last timestamp at which the signature is still valid. |
|
| A byte array signature. |
Returns
Name | Type | Description |
---|---|---|
|
| The total amount of token claimed by |
distribute
Distributes the unaccounted balance of token
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the token being distributed. |
Returns
Name | Type | Description |
---|---|---|
|
| 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
Name | Type | Description |
---|---|---|
|
| The address of some token. |
|
| The epoch number as a clock value. |
Returns
Name | Type | Description |
---|---|---|
|
| 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
Name | Type | Description |
---|---|---|
|
| The address of some token. |
|
| The address of some account. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of token that |
getClaimDigest
Returns the digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| The purported address of the signing account. |
|
| The address of the token being claimed. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
|
| The address the account where the claimed token will be sent. |
|
| The nonce of the account claiming the token. |
|
| The last timestamp at which the signature is still valid. |
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |
getDistributable
Returns the additional balance of token_
that is not yet distributed.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of some token. |
Returns
Name | Type | Description |
---|---|---|
|
| 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
Name | Type | Description |
---|---|---|
|
| The address of some token. |
|
| The epoch number as a clock value. |
|
| The address of some account. |
Returns
Name | Type | Description |
---|---|---|
|
| Whether |
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
Name | Type | Description |
---|---|---|
|
| The address of the token being claimed. |
|
| The address of the account claiming the distribution. |
|
| The starting epoch number as a clock value. |
|
| The ending epoch number as a clock value. |
|
| The total amount of token claimed by |
Distribution
Emitted when token
is distributed pro rata to all holders at epoch epoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the token being distributed. |
|
| The epoch number as a clock value. |
|
| 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
Name | Type | Description |
---|---|---|
|
| The timepoint being queried. |
|
| 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.