VotingReward

Overview

The VotingReward contract used by FeesVotingReward and BribeVotingReward allows to distribute rewards to users, earned through voting for a pool.

VotingReward Methods

getReward

Claim the rewards earned by a voter for a given token.

function getReward(
    address _user,
    address _token
) external
Input Parameter
Type
Description

_user

address

The address of the user voting.

_token

address

The token to claim rewards of.

getReward

Claim the rewards earned by a voter for a given token.

function getReward(
    address _user,
    address[] calldata _tokens
) external
Input Parameter
Type
Description

_user

address

The address of the user voting.

_tokens

address[] calldata

The array of tokens to claim rewards of.

_deposit

Deposit an amount into the rewards contract to earn future rewards.

Input Parameter
Type
Description

_amount

uint256

The amount deposited for the user.

_user

address

The address of the user.

_withdraw

Withdraw an amount from the rewards contract associated to a voter.

Input Parameter
Type
Description

_amount

uint256

The amount withdrawn for the user.

_user

address

The address of the user.

View Methods

dao

Return the address of DAO.

DURATION

Return the epoch duration constant (7 days).

voter

Return the address of Voter.sol.

poolId

Return the identifier of the pool this contrat is associated with.

totalSupply

Return the total amount currently deposited via _deposit().

balanceOf

Return the current amount deposited by given user.

tokenRewardsPerEpoch

Return the amount of tokens to reward depositors for a given epoch.

lastEarn

Return the most recent timestamp a user has claimed their rewards for given tokens.

rewards

Return the token address stored at the given index in the list of rewards token.

rewardsListLength

Return the number of rewards tokens.

getAllRewards

Return the list of rewards tokens.

isReward

Return wether a token is or has been an active reward token.

daoFee

Return the share of rewards to be sent to the DAO, in basis points.

numCheckpoints

Return the number of checkpoints for each user address.

supplyNumCheckpoints

Return the total number of checkpoints.

getPriorBalanceIndex

Return the prior balance for an account as of a block number.

Input Parameter
Type
Description

_user

address

The address of the user.

_timestamp

uint256

The timestamp to get the balance at.

getPriorSupplyIndex

Return the prior index of supply staked by a given timestamp.

Input Parameter
Type
Description

_timestamp

uint256

The timestamp to get the index at.

earned

Return how much in rewards are earned for a specific token and voter.

Input Parameter
Type
Description

_token

address

The token to fetch rewards of.

_user

address

The address of the user to check.

Last updated