MaverickV2VotingEscrow
Inherits: VotingEscrow
Provides staking, vote power history, vote delegation, and incentive disbursement to ve holders.
VotingEscrow
contract provides details on the staking and delegation features.
Incentive disbursement can take place in any token and happens when a user permissionlessly creates a new incentive batch for a specified amount of incentive tokens, timepoint, stake duration, and associated ERC-20 token. An incentive batch is a reward of incentives put up by the caller at a certain timepoint. The incentive batch is claimable by ve holders after the timepoint has passed. The ve holders will receive their incentive pro rata of their vote balance (pastbalanceOf
) at that timepoint. The incentivizer can specify that users have to stake the resulting incentive for a given stakeDuration
number of seconds. stakeDuration
can either be zero, meaning that no staking is required on redemption, or can be a number between MIN_STAKE_DURATION()
and MAX_STAKE_DURATION()
.
State Variables
_incentiveBatches
_tokenIncentiveTotals
incentiveBatchCount
This function retrieves the total number of created incentive batches.
Functions
constructor
createIncentiveBatch
This function creates a new incentive batch for a specified amount of incentive tokens, timepoint, stake duration, and associated ERC-20 token. An incentive batch is a reward of incentives put up by the caller at a certain timepoint. The incentive batch is claimable by ve holders after the timepoint has passed. The ve holders will receive their incentive pro rata of their vote balance (pastbalanceOf
) at that timepoint. The incentivizer can specify that users have to stake the resulting incentive for a given stakeDuration
number of seconds. stakeDuration
can either be zero, meaning that no staking is required on redemption, or can be a number between MIN_STAKE_DURATION()
and MAX_STAKE_DURATION()
.
Parameters
Name | Type | Description |
---|---|---|
|
| The total amount of incentive tokens to be distributed in the batch. |
|
| The timepoint at which the incentive batch starts accruing rewards. |
|
| The duration of the lockup period required to be eligible for the incentive batch rewards. |
|
| The address of the ERC20 token used for the incentive rewards. |
Returns
Name | Type | Description |
---|---|---|
|
| The index of the newly created incentive batch. |
claimFromIncentiveBatch
This function allows claiming rewards from a specific incentive batch, without extending any lockups.
Parameters
Name | Type | Description |
---|---|---|
|
| The index of the incentive batch from which to claim rewards. |
Returns
Name | Type | Description |
---|---|---|
|
| A Lockup struct containing details about the user's lockup that might have been affected by the claim (see struct definition for details). |
|
| The amount of tokens claimed from the incentive batch. |
claimFromIncentiveBatchAndExtend
This function allows claiming rewards from a specific incentive batch while simultaneously extending a lockup with the claimed tokens.
Parameters
Name | Type | Description |
---|---|---|
|
| The index of the incentive batch from which to claim rewards. |
|
| The ID of the lockup to be extended with the claimed tokens. |
Returns
Name | Type | Description |
---|---|---|
|
| A Lockup struct containing details about the updated lockup after extension (see struct definition for details). |
|
| The amount of tokens claimed from the incentive batch. |
incentiveTotals
This function retrieves the total incentive information for a specific ERC-20 token.
Parameters
Name | Type | Description |
---|---|---|
|
|
Returns
Name | Type | Description |
---|---|---|
|
| A TokenIncentiveTotals struct containing details about the token's incentives (see struct definition for details). |
claimInformation
This function retrieves claim information for a specific account and incentive batch index.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the account for which to retrieve claim information. |
|
| The index of the incentive batch for which to retrieve claim information. |
Returns
Name | Type | Description |
---|---|---|
|
| A ClaimInformation struct containing details about the account's claims for the specified batch (see struct definition for details). |
_claim
Structs
IncentiveSpecification
Last updated