Skip to content

ShortingRewards

Description

Source: contracts/ShortingRewards.sol

Architecture

Libraries

Inheritance Graph

graph TD ShortingRewards[ShortingRewards] --> RewardsDistributionRecipient[RewardsDistributionRecipient] ShortingRewards[ShortingRewards] --> Pausable[Pausable] ShortingRewards[ShortingRewards] --> MixinResolver[MixinResolver] 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

short

Source

Type: contract ICollateralErc20

synth

Source

Type: bytes32

userRewardPerTokenPaid

Source

Type: mapping(address => uint256)

Constructor

constructor

Source

Details

Signature

(address _owner, address _resolver, address _rewardsDistribution, address _rewardsToken, address _short, bytes32 _synth)

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

resolverAddressesRequired

Source

Details

Signature

resolverAddressesRequired() returns (bytes32[])

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

enrol

Source

Details

Signature

enrol(address account, uint256 amount)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

exit

Source

Details

Signature

exit(address account)

Visibility

external

State Mutability

nonpayable

Modifiers

notifyRewardAmount

Source

Details

Signature

notifyRewardAmount(uint256 reward)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

setRewardsDuration

Source

Details

Signature

setRewardsDuration(uint256 _rewardsDuration)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers

Emits

withdraw

Source

Details

Signature

withdraw(address account, uint256 amount)

Visibility

public

State Mutability

nonpayable

Requires

Modifiers

Emits

Internal Functions

_short

Source

Details

Signature

_short() returns (contract ICollateralErc20)

Visibility

internal

State Mutability

view

External Functions

getReward

Source

Details

Signature

getReward(address account)

Visibility

public

State Mutability

nonpayable

Modifiers

Modifiers

onlyShortContract

Source

updateReward

Source

Signature: updateReward(address account)

Events

Enrol

Source

Signature: Enrol(address user, uint256 amount)

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)

Withdrawn

Source

Signature: Withdrawn(address user, uint256 amount)