IVoter

Git Source

Interface for Infrared's voting system that manages votes for POL CuttingBoard allocation and bribe vault creation

Handles voting power allocation, managed veNFT deposits, and bribe distribution

Functions

ve

Returns the VotingEscrow contract address

function ve() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the VE token that governs these contracts

totalWeight

Returns total voting weight across all votes

function totalWeight() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Total weight sum of all active votes

maxVotingNum

Returns maximum number of staking tokens one voter can vote for

function maxVotingNum() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Maximum number of allowed votes per voter

feeVault

Returns global fee distribution vault address

function feeVault() external view returns (address);

Returns

NameTypeDescription
<none>addressAddress of the fee vault

bribeVaults

Returns bribe vault address for a given staking token

function bribeVaults(address stakingToken) external view returns (address);

Parameters

NameTypeDescription
stakingTokenaddressAddress of staking token

Returns

NameTypeDescription
<none>addressAddress of associated bribe vault

weights

Returns total weight allocated to a staking token

function weights(address stakingToken) external view returns (uint256);

Parameters

NameTypeDescription
stakingTokenaddressAddress of staking token

Returns

NameTypeDescription
<none>uint256Total voting weight for the token

votes

Returns vote weight allocated by token ID for specific staking token

function votes(uint256 tokenId, address stakingToken)
    external
    view
    returns (uint256);

Parameters

NameTypeDescription
tokenIduint256NFT token ID
stakingTokenaddressAddress of staking token

Returns

NameTypeDescription
<none>uint256Vote weight allocated

usedWeights

Returns total vote weight used by specific token ID

function usedWeights(uint256 tokenId) external view returns (uint256);

Parameters

NameTypeDescription
tokenIduint256NFT token ID

Returns

NameTypeDescription
<none>uint256Total used voting weight

lastVoted

Returns timestamp of last vote for a token ID

function lastVoted(uint256 tokenId) external view returns (uint256);

Parameters

NameTypeDescription
tokenIduint256NFT token ID

Returns

NameTypeDescription
<none>uint256Timestamp of last vote

isWhitelistedToken

Checks if a token is whitelisted for rewards

function isWhitelistedToken(address token) external view returns (bool);

Parameters

NameTypeDescription
tokenaddressAddress of token to check

Returns

NameTypeDescription
<none>boolTrue if token is whitelisted

isWhitelistedNFT

Checks if NFT is whitelisted for special voting

function isWhitelistedNFT(uint256 tokenId) external view returns (bool);

Parameters

NameTypeDescription
tokenIduint256NFT token ID to check

Returns

NameTypeDescription
<none>boolTrue if NFT is whitelisted

isAlive

Checks if bribe vault is active

function isAlive(address bribeVault) external view returns (bool);

Parameters

NameTypeDescription
bribeVaultaddressAddress of bribe vault to check

Returns

NameTypeDescription
<none>boolTrue if vault is active

length

Returns number of staking tokens with active bribe vaults

function length() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Count of staking tokens with bribe vaults

epochStart

Calculates start of epoch containing timestamp

function epochStart(uint256 _timestamp) external pure returns (uint256);

Parameters

NameTypeDescription
_timestampuint256Input timestamp

Returns

NameTypeDescription
<none>uint256Start of epoch time

epochNext

Calculates start of next epoch after timestamp

function epochNext(uint256 _timestamp) external pure returns (uint256);

Parameters

NameTypeDescription
_timestampuint256Input timestamp

Returns

NameTypeDescription
<none>uint256Start of next epoch time

epochVoteStart

Calculates start of voting window for epoch containing timestamp

function epochVoteStart(uint256 _timestamp) external pure returns (uint256);

Parameters

NameTypeDescription
_timestampuint256Input timestamp

Returns

NameTypeDescription
<none>uint256Vote window start time

epochVoteEnd

Calculates end of voting window for epoch containing timestamp

function epochVoteEnd(uint256 _timestamp) external pure returns (uint256);

Parameters

NameTypeDescription
_timestampuint256Input timestamp

Returns

NameTypeDescription
<none>uint256Vote window end time

poke

Updates voting balances in rewards contracts for a token ID

Should be called after any action that affects vote weight

function poke(uint256 _tokenId) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID to update

vote

Distributes voting weight to multiple staking tokens

Weight is allocated proportionally based on provided weights

function vote(
    uint256 _tokenId,
    address[] calldata _stakingTokenVote,
    uint256[] calldata _weights
) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID voting with
_stakingTokenVoteaddress[]Array of staking token addresses receiving votes
_weightsuint256[]Array of weights to allocate to each token

reset

Resets voting state for a token ID

Required before making changes to veNFT state

function reset(uint256 _tokenId) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID to reset

depositManaged

Deposits veNFT into a managed NFT

NFT will be re-locked to max time on withdrawal

function depositManaged(uint256 _tokenId, uint256 _mTokenId) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID to deposit
_mTokenIduint256Managed NFT token ID to deposit into

withdrawManaged

Withdraws veNFT from a managed NFT

Withdrawing locks NFT to max lock time

function withdrawManaged(uint256 _tokenId) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID to withdraw

claimBribes

Claims bribes from multiple sources for a veNFT

function claimBribes(
    address[] memory _bribes,
    address[][] memory _tokens,
    uint256 _tokenId
) external;

Parameters

NameTypeDescription
_bribesaddress[]Array of bribe vault addresses to claim from
_tokensaddress[][]Array of reward tokens to claim for each vault
_tokenIduint256veNFT token ID to claim for

claimFees

Claims fee rewards for a veNFT

function claimFees(address[] memory _tokens, uint256 _tokenId) external;

Parameters

NameTypeDescription
_tokensaddress[]Array of fee tokens to claim
_tokenIduint256veNFT token ID to claim for

setMaxVotingNum

Updates maximum allowed votes per voter

function setMaxVotingNum(uint256 _maxVotingNum) external;

Parameters

NameTypeDescription
_maxVotingNumuint256New maximum number of allowed votes

whitelistNFT

Updates whitelist status for veNFT for privileged voting

function whitelistNFT(uint256 _tokenId, bool _bool) external;

Parameters

NameTypeDescription
_tokenIduint256veNFT token ID to update
_boolboolNew whitelist status

createBribeVault

Creates new bribe vault for staking token

function createBribeVault(
    address _stakingToken,
    address[] calldata _rewardTokens
) external returns (address);

Parameters

NameTypeDescription
_stakingTokenaddressAddress of staking token
_rewardTokensaddress[]Array of reward token addresses

Returns

NameTypeDescription
<none>addressAddress of created bribe vault

killBribeVault

Disables a bribe vault

function killBribeVault(address _stakingToken) external;

Parameters

NameTypeDescription
_stakingTokenaddressAddress of staking token for vault to disable

reviveBribeVault

Re-enables a disabled bribe vault

function reviveBribeVault(address _stakingToken) external;

Parameters

NameTypeDescription
_stakingTokenaddressAddress of staking token for vault to re-enable

Events

BribeVaultCreated

Emitted when a new bribe vault is created

event BribeVaultCreated(
    address stakingToken, address bribeVault, address creator
);

Parameters

NameTypeDescription
stakingTokenaddressThe staking token address for which the vault was created
bribeVaultaddressThe address of the newly created bribe vault
creatoraddressThe address that created the bribe vault

BribeVaultKilled

Emitted when a bribe vault is killed (disabled)

event BribeVaultKilled(address indexed bribeVault);

Parameters

NameTypeDescription
bribeVaultaddressThe address of the killed bribe vault

BribeVaultRevived

Emitted when a killed bribe vault is revived (re-enabled)

event BribeVaultRevived(address indexed bribeVault);

Parameters

NameTypeDescription
bribeVaultaddressThe address of the revived bribe vault

Voted

Emitted when votes are cast for a staking token

event Voted(
    address indexed voter,
    address indexed stakingToken,
    uint256 indexed tokenId,
    uint256 weight,
    uint256 totalWeight,
    uint256 timestamp
);

Parameters

NameTypeDescription
voteraddressAddress of the account casting the vote
stakingTokenaddressThe staking token being voted for
tokenIduint256ID of the veNFT used to vote
weightuint256Vote weight allocated
totalWeightuint256New total vote weight for the staking token
timestampuint256Block timestamp when vote was cast

Abstained

Emitted when votes are withdrawn/reset

event Abstained(
    address indexed voter,
    address indexed stakingToken,
    uint256 indexed tokenId,
    uint256 weight,
    uint256 totalWeight,
    uint256 timestamp
);

Parameters

NameTypeDescription
voteraddressAddress of the account withdrawing votes
stakingTokenaddressThe staking token votes are withdrawn from
tokenIduint256ID of the veNFT used to vote
weightuint256Vote weight withdrawn
totalWeightuint256New total vote weight for the staking token
timestampuint256Block timestamp when votes were withdrawn

WhitelistNFT

Emitted when an NFT's whitelist status changes

event WhitelistNFT(
    address indexed whitelister, uint256 indexed tokenId, bool indexed _bool
);

Parameters

NameTypeDescription
whitelisteraddressAddress making the whitelist change
tokenIduint256ID of the NFT being whitelisted/unwhitelisted
_boolboolNew whitelist status

SkipKilledBribeVault

Emitted when a killed bribe vault is skipped

event SkipKilledBribeVault(
    address indexed stakingToken, uint256 indexed tokenId
);

Parameters

NameTypeDescription
stakingTokenaddressAddress of staking token for vault to skip
tokenIduint256ID of the veNFT used to vote

MaxVotingNumSet

Emitted when maximum voting number is set

event MaxVotingNumSet(uint256 indexed maxVotingNum);

Parameters

NameTypeDescription
maxVotingNumuint256New maximum number of allowed votes

Errors

AlreadyVotedOrDeposited

error AlreadyVotedOrDeposited();

BribeVaultAlreadyKilled

error BribeVaultAlreadyKilled();

BribeVaultAlreadyRevived

error BribeVaultAlreadyRevived();

BribeVaultExists

error BribeVaultExists();

BribeVaultDoesNotExist

error BribeVaultDoesNotExist(address _stakingToken);

BribeVaultNotAlive

error BribeVaultNotAlive(address _stakingToken);

InactiveManagedNFT

error InactiveManagedNFT();

MaximumVotingNumberTooLow

error MaximumVotingNumberTooLow();

NonZeroVotes

error NonZeroVotes();

NotAStakingToken

error NotAStakingToken();

NotApprovedOrOwner

error NotApprovedOrOwner();

NotWhitelistedNFT

error NotWhitelistedNFT();

NotWhitelistedToken

error NotWhitelistedToken();

SameValue

error SameValue();

SpecialVotingWindow

error SpecialVotingWindow();

TooManyStakingTokens

error TooManyStakingTokens();

UnequalLengths

error UnequalLengths();

ZeroBalance

error ZeroBalance();

ZeroAddress

error ZeroAddress();

VaultNotRegistered

error VaultNotRegistered();

NotGovernor

error NotGovernor();

DistributeWindow

error DistributeWindow();