StakingRewards¶
Description¶
Source: contracts/StakingRewards.sol
Variables¶
lastUpdateTime
¶
Type: uint256
periodFinish
¶
Type: uint256
rewardPerTokenStored
¶
Type: uint256
rewardRate
¶
Type: uint256
rewards
¶
Type: mapping(address => uint256)
rewardsDuration
¶
Type: uint256
rewardsToken
¶
Type: contract IERC20
stakingToken
¶
Type: contract IERC20
userRewardPerTokenPaid
¶
Type: mapping(address => uint256)
Constructor¶
constructor
¶
Details
Signature
constructor(address _owner, address _rewardsDistribution, address _rewardsToken, address _stakingToken)
Visibility
public
State Mutability
``
Views¶
balanceOf
¶
Details
Signature
balanceOf(address account) view returns (uint256)
Visibility
external
State Mutability
view
earned
¶
Details
Signature
earned(address account) view returns (uint256)
Visibility
public
State Mutability
view
getRewardForDuration
¶
Details
Signature
getRewardForDuration() view returns (uint256)
Visibility
external
State Mutability
view
lastTimeRewardApplicable
¶
Details
Signature
lastTimeRewardApplicable() view returns (uint256)
Visibility
public
State Mutability
view
rewardPerToken
¶
Details
Signature
rewardPerToken() view returns (uint256)
Visibility
public
State Mutability
view
totalSupply
¶
Details
Signature
totalSupply() view returns (uint256)
Visibility
external
State Mutability
view
Restricted Functions¶
notifyRewardAmount
¶
Details
Signature
notifyRewardAmount(uint256 reward)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
recoverERC20
¶
Details
Signature
recoverERC20(address tokenAddress, uint256 tokenAmount)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
setRewardsDuration
¶
Details
Signature
setRewardsDuration(uint256 _rewardsDuration)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
External Functions¶
exit
¶
Details
Signature
exit()
Visibility
external
State Mutability
``
getReward
¶
Details
Signature
getReward()
Visibility
public
State Mutability
``
Modifiers
stake
¶
Details
Signature
stake(uint256 amount)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
withdraw
¶
Details
Signature
withdraw(uint256 amount)
Visibility
public
State Mutability
``
Requires
Modifiers
Emits
Modifiers¶
updateReward
¶
Signature: updateReward(address account)
Events¶
Recovered
¶
Signature: Recovered(address token, uint256 amount)
RewardAdded
¶
Signature: RewardAdded(uint256 reward)
RewardPaid
¶
Signature: RewardPaid(address user, uint256 reward)
RewardsDurationUpdated
¶
Signature: RewardsDurationUpdated(uint256 newDuration)
Staked
¶
Signature: Staked(address user, uint256 amount)
Withdrawn
¶
Signature: Withdrawn(address user, uint256 amount)