Voter
Last updated
Last updated
The Voter
contract allows to vote for the proportion of weekly emissions that go to each pool LPs, as well as and voting rewards creation. Votes can be cast once per epoch, and earn voters both bribes and fees from the pool they voted for.
Given that votes for pools across all supported networks are managed on Ethereum, each pool is identified by a unique ID, in order to prevent address collusion, which may occur if two pools on different networks happen to share the same address.
Pool IDs can be obtained from GovernanceRegistry
's getPoolId()
function.
Handles the execution of command sequence.
Input Parameter | Type | Description |
---|---|---|
Called by users to update voting balances in voting rewards contracts.
Called by approved address to vote for multiple users for pools. For each user, votes are distributed proportionally based on weights.
Each user can only vote once per epoch.
Users can only vote for registered pools with deployed voting rewards.
Weights are distributed proportionally to the sum of the weights in the array.
Throws if length of _poolVote and _weights do not match.
Called by approved address to update voting balances for multiple users in voting rewards contracts.
Called by users to reset voting state.
Can vote again after reset.
Cannot reset in the same epoch that you voted in.
Bulk claim bribes for a given user address.
Bulk claim fees for a given user address.
Bulk claim bribes and fees for a given user address.
Create voting rewards for a pool (unpermissioned).
Only one pair of voting rewards can be created for any pool. See Voter
's hasVotingRewards()
.
Pool needs to be registered in governance registry. See GovernanceRegistry
's isPoolRegistered()
.
Give or take back approval for an operator to manage voting and rewards claiming on behalf of sender.
Return the address of DAO.
Return the address of trusted forwarder.
Return the address of the ve token that governs these contracts.
Return the address of GovernanceRegistry.
Return the total voting weight.
Return the max number of pools one voter can vote for at once.
Return the default share of fees voting rewards to be sent to the DAO, in basis points.
Return the default share of bribe voting rewards to be sent to the DAO, in basis points.
Return the pool identifier stored at the given index in the list of identifiers of pools supporting voting rewards.
Return the number of pools with associated voting rewards.
Return the list of all pool identifiers for pools with associated voting rewards.
Return wether voting rewards are deployed for a given pool.
Return the FeesVotingRewards contract associated with given pool.
Return the BribeVotingRewards contract associated with given pool.
Return the total voting weight for a given pool.
Return the voting weight attributed by a given user to a given pool.
Return the total used voting weight of a given user.
Return the timestamp of last votefor a given user.
Return wether a token is whitelisted as a possible bribe reward.
Return wether a user is whitelisted to vote outside of voting periods.
Return wether voting authorized for a given pool.
Return wether a given user currently has a voting position.
Return wether a given user is restricted from voting.
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
Return Parameter | Type | Description |
---|---|---|
Input Parameter | Type | Description |
---|---|---|
_user
address
The address of the user voting.
_poolVote
uint160[] calldata
The array of identifiers of pools that are voted for.
_weights
uint256[] calldata
The weights of pools.
_user
address
Address of the user whose balance are to be updated.
_users
address[] calldata
The addresses of the users voting.
_poolVote
uint160[] calldata
The array of identifiers of pools that are voted for.
_weights
uint256[] calldata
The weights of pools.
_users
address[] calldata
The addresses of the users whose balance are to be updated.
_user
address
Address of the user reseting.
_bribes
address[] calldata
The array of BribeVotingReward contracts to collect from.
_tokens
address[][] calldata
The array of tokens that are used as bribes.
_user
address
The address of the user to claim bribe rewards for.
_fees
address[] calldata
The array of FeesVotingReward contracts to collect from.
_tokens
address[][] calldata
The array of tokens that are used as bribes.
_user
address
The address of the user to claim fees rewards for.
_poolIds
uint160[] calldata
The array of pool identifiers to collect associated bribes and fees from.
_bribeTokens
address[][] calldata
The array of list of tokens that are used as bribes for each pool.
_feeTokens
address[][] calldata
The array of list of tokens that are used as fees rewards for each pool.
_user
address
The address of the user to claim bribe and fees rewards for.
_poolId
uint160
The identifier of the pool.
fees
address
The address of created FeesVotingReward.
bribe
address
The address of created BribeVotingReward.
_operator
address
The address to set approval for.
_approved
bool
True to approve operator, false otherwise.