IMaverickV2IncentiveMatcher
Functions
checkpointData
This function retrieves checkpoint data for a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch for which to retrieve checkpoint data. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of match tokens budgeted for the epoch. |
|
| The amount of vote tokens budgeted for the epoch. |
|
| The total number of votes cast in the epoch. |
|
| The total amount of external incentives added for the epoch. |
checkpointRewardData
This function retrieves checkpoint data for a specific reward contract within an epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch for which to retrieve checkpoint data. |
|
| The address of the reward contract. |
Returns
Name | Type | Description |
---|---|---|
|
| The total number of votes cast for the reward contract in the epoch. |
|
| The total amount of external incentives added for the reward contract in the epoch. |
isEpoch
This function checks if a given epoch is valid.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the epoch input is a valid epoch, False otherwise. |
lastEpoch
This function retrieves the number of the most recently completed epoch.
Returns
Name | Type | Description |
---|---|---|
|
| The number of the last epoch. |
epochIsOver
This function checks if a specific epoch has ended.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the epoch has ended, False otherwise. |
vetoingIsActive
This function checks if the vetoing period is active for a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the vetoing period is active, False otherwise. |
votingIsActive
This function checks if the voting period is active for a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the voting period is active, False otherwise. |
currentEpoch
This function retrieves the current epoch number.
Returns
Name | Type | Description |
---|---|---|
|
| The current epoch number. |
votingStart
Returns the timestamp when voting starts. This is also the voting snapshot timestamp where the voting power for users is determined for that epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
addMatchingBudget
This function allows adding a new budget to the matcher contract.
called by protocol to add base token budget to an epoch that will be used for matching incentives. Can be called anytime before or during the epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The amount of match tokens to add. |
|
| The amount of vote tokens to add. |
|
| The epoch for which the budget is added. |
rewardHasVe
This function checks if a specific reward contract has a veToken staking option.
For a rewards contract to be eligible for matching, the rewards contract must have the baseToken's ve contract as a locking option.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the reward contract. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the reward contract has a veToken staking option, False otherwise. |
addIncentives
This function allows adding a new incentive to the system.
Called by protocol to add incentives to a given rewards contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the reward contract for the incentive. |
|
| The total amount of the incentive. |
|
| The duration (in epochs) for which this incentive will be active. |
Returns
Name | Type | Description |
---|---|---|
|
| The duration (in epochs) for which this incentive was added. |
vote
This function allows a user to cast a vote for specific reward contracts.
Called by ve token holders to vote for rewards contracts in a given epoch. voteTargets have to be passed in ascending sort order as a unique set of values. weights are relative values that are scales by the user's voting power.
Parameters
Name | Type | Description |
---|---|---|
|
| An array of addresses for the reward contracts to vote for. |
|
| An array of weights for each vote target. |
veto
This function allows casting a veto on a specific reward contract for an epoch.
Veto a given rewards contract. If a rewards contract is vetoed, it will not receive any matching incentives. Rewards contracts can only be vetoed in the VETO_PERIOD seconds after the end of the epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the reward contract to veto. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of veto power used (based on the user's epoch match contribution). |
distribute
This function allows distributing incentives for a specific reward contract in a particular epoch.
Called by any user to distribute matching incentives to a given reward contract for a given epoch. Call is only functional after the vetoing period for the epoch is over.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the reward contract to distribute incentives for. |
|
| The epoch for which to distribute incentives. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of matching tokens distributed. |
rolloverExcessBudget
This function allows rolling over excess budget from a previous epoch to a new epoch.
Excess vote match budget amounts that have not been distributed will not rollover and will become permanently locked. To avoid this, a matcher should call distribute on all rewards contracts before calling rollover.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch from which to roll over the budget. |
|
| The epoch to which to roll over the budget. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of match tokens rolled over. |
|
| The amount of vote tokens rolled over. |
EPOCH_PERIOD
This function retrieves the epoch period length.
PRE_VOTE_PERIOD
This function retrieves the period length of the epoch before voting starts. After an epoch begins, there is a window of time where voting is not possible which is the value this function returns.
VETO_PERIOD
This function retrieves the vetoing period length.
NOTIFY_PERIOD
The function retrieves the notify period length, which is the amount of time in seconds during which the matching reward will be distributed through the rewards contract.
baseToken
This function retrieves the base token used by the IncentiveMatcher contract.
Returns
Name | Type | Description |
---|---|---|
|
| The address of the base token. |
factory
This function retrieves the address of the MaverickV2RewardFactory contract.
Returns
Name | Type | Description |
---|---|---|
|
| The address of the MaverickV2RewardFactory contract. |
veToken
This function retrieves the address of the veToken contract.
Returns
Name | Type | Description |
---|---|---|
|
| The address of the veToken contract. |
hasVoted
This function checks if a specific user has voted in a particular epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the user. |
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the user has voted, False otherwise. |
hasVetoed
This function checks if a specific matcher has cast a veto on a reward contract for an epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the IncentiveMatcher contract. |
|
| The address of the reward contract. |
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the matcher has cast a veto, False otherwise. |
hasDistributed
This function checks if incentives have been distributed for a specific reward contract in an epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the reward contract. |
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if incentives have been distributed, False otherwise. |
epochEnd
This function calculates the end timestamp for a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch for which to calculate the end timestamp. |
Returns
Name | Type | Description |
---|---|---|
|
| The end timestamp of the epoch. |
vetoingEnd
This function calculates the end timestamp for the vetoing period of a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch for which to calculate the vetoing period end timestamp. |
Returns
Name | Type | Description |
---|---|---|
|
| The end timestamp of the vetoing period for the epoch. |
vetoingIsOver
This function checks if the vetoing period is over for a specific epoch.
Parameters
Name | Type | Description |
---|---|---|
|
| The epoch to check. |
Returns
Name | Type | Description |
---|---|---|
|
| True if the vetoing period has ended for the given epoch, False otherwise. |
Events
BudgetAdded
BudgetRolledOver
IncentiveAdded
Vote
Distribute
Veto
Errors
IncentiveMatcherInvalidEpoch
IncentiveMatcherNotRewardFactoryContract
IncentiveMatcherEpochHasNotEnded
IncentiveMatcherVotePeriodNotActive
IncentiveMatcherVetoPeriodNotActive
IncentiveMatcherVetoPeriodHasNotEnded
IncentiveMatcherSenderHasAlreadyVoted
IncentiveMatcherSenderHasNoVotingPower
IncentiveMatcherInvalidTargetOrder
IncentiveMatcherInvalidVote
IncentiveMatcherNoExternalIncentivesToDistributed
IncentiveMatcherEpochAlreadyDistributed
IncentiveMatcherEpochHasPassed
IncentiveMatcherRewardDoesNotHaveVeStakingOption
IncentiveMatcherMatcherAlreadyVetoed
IncentiveMatcherNothingToRollover
Last updated