ShortingRewards¶
Description¶
Source: contracts/ShortingRewards.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
userRewardPerTokenPaid
¶
Type: mapping(address => uint256)
Constructor¶
constructor
¶
Details
Signature
constructor(address _owner, address _resolver, address _rewardsDistribution, address _rewardsToken)
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
resolverAddressesRequired
¶
Details
Signature
resolverAddressesRequired() view returns (bytes32[] addresses)
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¶
enrol
¶
Details
Signature
enrol(address account, uint256 amount)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
notifyRewardAmount
¶
Details
Signature
notifyRewardAmount(uint256 reward)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
setRewardsDuration
¶
Details
Signature
setRewardsDuration(uint256 _rewardsDuration)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
withdraw
¶
Details
Signature
withdraw(address account, uint256 amount)
Visibility
external
State Mutability
``
Requires
Modifiers
Emits
Internal Functions¶
_short
¶
Details
Signature
_short() view returns (contract ICollateralErc20)
Visibility
internal
State Mutability
view
External Functions¶
getReward
¶
Details
Signature
getReward(address account)
Visibility
external
State Mutability
``
Modifiers
Modifiers¶
onlyShortContract
¶
updateReward
¶
Signature: updateReward(address account)
Events¶
Enrol
¶
Signature: Enrol(address user, uint256 amount)
RewardAdded
¶
Signature: RewardAdded(uint256 reward)
RewardPaid
¶
Signature: RewardPaid(address user, uint256 reward)
RewardsDurationUpdated
¶
Signature: RewardsDurationUpdated(uint256 newDuration)
Withdrawn
¶
Signature: Withdrawn(address user, uint256 amount)