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

mapping(uint256 => IncentiveSpecification) private _incentiveBatches;

_tokenIncentiveTotals

mapping(IERC20 => TokenIncentiveTotals) private _tokenIncentiveTotals;

incentiveBatchCount

This function retrieves the total number of created incentive batches.

uint256 public incentiveBatchCount;

Functions

constructor

constructor(string memory __name, string memory __symbol) VotingEscrow(__name, __symbol);

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().

function createIncentiveBatch(uint128 amount, uint48 timepoint, uint128 stakeDuration, IERC20 incentiveToken)
    public
    returns (uint256 index);

Parameters

Returns

claimFromIncentiveBatch

This function allows claiming rewards from a specific incentive batch, without extending any lockups.

function claimFromIncentiveBatch(uint256 batchIndex) public returns (Lockup memory lockup, uint128 claimAmount);

Parameters

Returns

claimFromIncentiveBatchAndExtend

This function allows claiming rewards from a specific incentive batch while simultaneously extending a lockup with the claimed tokens.

function claimFromIncentiveBatchAndExtend(uint256 batchIndex, uint256 lockupId)
    public
    returns (Lockup memory lockup, uint128 claimAmount);

Parameters

Returns

incentiveTotals

This function retrieves the total incentive information for a specific ERC-20 token.

function incentiveTotals(IERC20 incentiveToken) external view returns (TokenIncentiveTotals memory totals);

Parameters

Returns

claimInformation

This function retrieves claim information for a specific account and incentive batch index.

function claimInformation(address account, uint256 batchIndex) public view returns (ClaimInformation memory info);

Parameters

Returns

_claim

function _claim(uint256 batchIndex)
    internal
    returns (uint128 claimAmount, uint256 stakeDuration, IERC20 incentiveToken);

Structs

IncentiveSpecification

struct IncentiveSpecification {
    uint128 totalIncentives;
    uint128 stakeDuration;
    uint48 claimTimepoint;
    IERC20 incentiveToken;
    mapping(address => bool) hasClaimed;
}

Last updated