Skip to content

StakingRewards

Description

Source: contracts/StakingRewards.sol

Architecture

Libraries

Inheritance Graph

graph TD StakingRewards[StakingRewards] --> RewardsDistributionRecipient[RewardsDistributionRecipient] StakingRewards[StakingRewards] --> Pausable[Pausable] RewardsDistributionRecipient[RewardsDistributionRecipient] --> Owned[Owned] Pausable[Pausable] --> Owned[Owned]

Variables

lastUpdateTime

Source

Type: uint256

periodFinish

Source

Type: uint256

rewardPerTokenStored

Source

Type: uint256

rewardRate

Source

Type: uint256

rewards

Source

Type: mapping(address => uint256)

rewardsDuration

Source

Type: uint256

rewardsToken

Source

Type: contract IERC20

stakingToken

Source

Type: contract IERC20

userRewardPerTokenPaid

Source

Type: mapping(address => uint256)

Constructor

constructor

Source

Details

Signature

(address _owner, address _rewardsDistribution, address _rewardsToken, address _stakingToken)

Visibility

public

State Mutability

nonpayable

Views

balanceOf

Source

Details

Signature

balanceOf(address account) returns (uint256)

Visibility

external

State Mutability

view

earned

Source

Details

Signature

earned(address account) returns (uint256)

Visibility

public

State Mutability

view

getRewardForDuration

Source

Details

Signature

getRewardForDuration() returns (uint256)

Visibility

external

State Mutability

view

lastTimeRewardApplicable

Source

Details

Signature

lastTimeRewardApplicable() returns (uint256)

Visibility

public

State Mutability

view

rewardPerToken

Source

Details

Signature

rewardPerToken() returns (uint256)

Visibility

public

State Mutability

view

totalSupply

Source

Details

Signature

totalSupply() returns (uint256)

Visibility

external

State Mutability

view

Restricted Functions

notifyRewardAmount

Source

Details

Signature

notifyRewardAmount(uint256 reward)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

recoverERC20

Source

Details

Signature

recoverERC20(address tokenAddress, uint256 tokenAmount)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

setRewardsDuration

Source

Details

Signature

setRewardsDuration(uint256 _rewardsDuration)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

External Functions

exit

Source

Details

Signature

exit()

Visibility

external

State Mutability

nonpayable

getReward

Source

Details

Signature

getReward()

Visibility

public

State Mutability

nonpayable

Modifiers

stake

Source

Details

Signature

stake(uint256 amount)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

withdraw

Source

Details

Signature

withdraw(uint256 amount)

Visibility

public

State Mutability

nonpayable

Requires

Modifiers

Emits

Modifiers

updateReward

Source

Signature: updateReward(address account)

Events

Recovered

Source

Signature: Recovered(address token, uint256 amount)

RewardAdded

Source

Signature: RewardAdded(uint256 reward)

RewardPaid

Source

Signature: RewardPaid(address user, uint256 reward)

RewardsDurationUpdated

Source

Signature: RewardsDurationUpdated(uint256 newDuration)

Staked

Source

Signature: Staked(address user, uint256 amount)

Withdrawn

Source

Signature: Withdrawn(address user, uint256 amount)