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().
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
amount
uint128
The total amount of incentive tokens to be distributed in the batch.
timepoint
uint48
The timepoint at which the incentive batch starts accruing rewards.
stakeDuration
uint128
The duration of the lockup period required to be eligible for the incentive batch rewards.
incentiveToken
IERC20
The address of the ERC20 token used for the incentive rewards.
Returns
Name
Type
Description
index
uint256
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
batchIndex
uint256
The index of the incentive batch from which to claim rewards.
Returns
Name
Type
Description
lockup
Lockup
A Lockup struct containing details about the user's lockup that might have been affected by the claim (see struct definition for details).
claimAmount
uint128
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
batchIndex
uint256
The index of the incentive batch from which to claim rewards.
lockupId
uint256
The ID of the lockup to be extended with the claimed tokens.
Returns
Name
Type
Description
lockup
Lockup
A Lockup struct containing details about the updated lockup after extension (see struct definition for details).
claimAmount
uint128
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
incentiveToken
IERC20
Returns
Name
Type
Description
totals
TokenIncentiveTotals
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
account
address
The address of the account for which to retrieve claim information.
batchIndex
uint256
The index of the incentive batch for which to retrieve claim information.
Returns
Name
Type
Description
info
ClaimInformation
A ClaimInformation struct containing details about the account's claims for the specified batch (see struct definition for details).