PoolRewardsStorage

PoolRewardsStorage

This contract keeps track of addresses used by the PoolRewards contract to compute and distribute vVSP "rewards".

pool

1
address pool
Copied!
Vesper pool address

rewardTokens

1
address[] rewardTokens
Copied!
Array of reward token addresses

isRewardToken

1
mapping(address => bool) isRewardToken
Copied!
Reward token to valid/invalid flag mapping

periodFinish

1
mapping(address => uint256) periodFinish
Copied!
Reward token to period ending of current reward

rewardRates

1
mapping(address => uint256) rewardRates
Copied!
Reward token to current reward rate mapping

rewardDuration

1
mapping(address => uint256) rewardDuration
Copied!
Reward token to Duration of current reward distribution

lastUpdateTime

1
mapping(address => uint256) lastUpdateTime
Copied!
Reward token to Last reward drip update time stamp mapping

rewardPerTokenStored

1
mapping(address => uint256) rewardPerTokenStored
Copied!
Reward token to Reward per token mapping. Calculated and stored at last drip update

userRewardPerTokenPaid

1
mapping(address => mapping(address => uint256)) userRewardPerTokenPaid
Copied!
Reward token => User => Reward per token stored at last reward update

rewards

1
mapping(address => mapping(address => uint256)) rewards
Copied!
RewardToken => User => Rewards earned till last reward update

PoolRewards

Distributes rewards based on Vesper pool balance and supply.

VERSION

1
string VERSION
Copied!

initialize

1
function initialize(address _pool, address[] _rewardTokens) public
Copied!
Called by proxy to initialize this contract
Name
Type
Description
_pool
address
Vesper pool address
_rewardTokens
address[]
Array of reward token addresses

notifyRewardAmount

1
function notifyRewardAmount(address[] _rewardTokens, uint256[] _rewardAmounts, uint256[] _rewardDurations) external virtual
Copied!
Notify that reward is added. Only authorized caller can call
Also updates reward rate and reward earning period.
Name
Type
Description
_rewardTokens
address[]
Tokens being rewarded
_rewardAmounts
uint256[]
Rewards amount for token on same index in rewardTokens array
_rewardDurations
uint256[]
Duration for which reward will be distributed

notifyRewardAmount

1
function notifyRewardAmount(address _rewardToken, uint256 _rewardAmount, uint256 _rewardDuration) external virtual
Copied!

addRewardToken

1
function addRewardToken(address _newRewardToken) external
Copied!
Add new reward token in existing rewardsToken array

claimReward

1
function claimReward(address _account) external virtual
Copied!
Claim earned rewards.
This function will claim rewards for all tokens being rewarded

updateReward

1
function updateReward(address _account) external
Copied!
Updated reward for given account.

claimable

1
function claimable(address _account) external view virtual returns (address[] _rewardTokens, uint256[] _claimableAmounts)
Copied!
Returns claimable reward amount.
Name
Type
Description
_rewardTokens
address[]
Array of tokens being rewarded
_claimableAmounts
uint256[]
Array of claimable for token on same index in rewardTokens

getRewardTokens

1
function getRewardTokens() external view returns (address[])
Copied!
Provides easy access to all rewardTokens

lastTimeRewardApplicable

1
function lastTimeRewardApplicable(address _rewardToken) public view returns (uint256)
Copied!
Returns timestamp of last reward update

rewardForDuration

1
function rewardForDuration() external view returns (address[] _rewardTokens, uint256[] _rewardForDuration)
Copied!

rewardPerToken

1
function rewardPerToken() external view returns (address[] _rewardTokens, uint256[] _rewardPerTokenRate)
Copied!
Rewards rate per pool token
Name
Type
Description
_rewardTokens
address[]
Array of tokens being rewarded
_rewardPerTokenRate
uint256[]
Array of Rewards rate for token on same index in rewardTokens