DistributionVault
Inherits: IDistributionVault, StatefulERC712
Author: M^0 Labs
State Variables
_GRANULARITY
The scale to apply when accumulating an account's claimable token, per epoch, before dividing. It is arbitrarily set to 1e9
. The smaller it is, the more dust will accumulate in the contract. Conversely, the larger it is, the more likely it is to overflow when accumulating. The more epochs that are claimed at once, the less dust will remain.
CLAIM_TYPEHASH
Returns the EIP712 typehash used in the encoding of the digest for the claimBySig function.
zeroToken
Returns the address of the Zero Token holders must have in order to be eligible for distributions.
_lastTokenBalances
The last recorded balance per token.
distributionOfAt
Returns the total amount of token
eligible for distribution to holder at the end of epoch epoch
.
hasClaimed
Returns whether account
has already claimed their token
distribution for epoch
.
Functions
constructor
Constructs a new DistributionVault contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the Zero Token contract. |
claim
Allows a caller to claim token
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| claimed 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 |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| claimed 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 |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| claimed The total amount of token claimed by |
distribute
Distributes the unaccounted balance of token
.
Parameters
Name | Type | Description |
---|---|---|
|
|
Returns
Name | Type | Description |
---|---|---|
|
| The total amount of additional tokens accounted in this distribution event. |
name
Returns the name of the contract.
CLOCK_MODE
Returns a machine-readable string description of the clock the contract is operating on.
getClaimDigest
Returns the digest to be signed, via EIP-712, given an internal digest (i.e. hash struct).
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| The digest to be signed. |
clock
Returns the current timepoint according to the mode the contract is operating on.
getClaimable
Returns the amount of token
account
can claim between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
|
Returns
Name | Type | Description |
---|---|---|
|
| The amount of token that |
getDistributable
Returns the additional balance of token_
that is not yet distributed.
Parameters
Name | Type | Description |
---|---|---|
|
|
Returns
Name | Type | Description |
---|---|---|
|
| The total amount of token owned by the vault that is yet to be distributed. |
_claim
Allows a caller to claim token_
distribution between inclusive epochs startEpoch
and endEpoch
.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account claiming the token. |
|
| 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 |