EcdPtpRewardPool
Functionsβ
totalSupplyβ
function totalSupply(
) public returns (uint256)
The sum of all the staked tokens
Return Values:β
Name | Type | Description |
---|---|---|
_totalSupply | The total supply |
balanceOfβ
function balanceOf(
) public returns (uint256)
Balance of staked tokens for a user
Return Values:β
Name | Type | Description |
---|---|---|
Balance | address | of the user |
extraRewardsLengthβ
function extraRewardsLength(
) external returns (uint256)
Get the number of extraRewards
Return Values:β
Name | Type | Description |
---|---|---|
the | extraRewards length |
setEmissionRateβ
function setEmissionRate(
uint256 _emissionRate
) external
Queue a new emission rate
Parameters:β
Name | Type | Description |
---|---|---|
_emissionRate | uint256 | new emission rate |
commitEmissionRateβ
function commitEmissionRate(
) external
Commit emission rate.
addExtraRewardβ
function addExtraReward(
) external returns (bool)
Add an extraReward to the extraRewards list @param _reward The address of the reward pool.
clearExtraRewardsβ
function clearExtraRewards(
) external
Remove the list of extraRewards.
lastTimeRewardApplicableβ
function lastTimeRewardApplicable(
) public returns (uint256)
Returns the timestamp to conside for reward distribution.
Return Values:β
Name | Type | Description |
---|---|---|
a | timestamp |
rewardPerTokenβ
function rewardPerToken(
) public returns (uint256)
Returns the amount of rewards per staked token.
Return Values:β
Name | Type | Description |
---|---|---|
amount | of rewards |
earnedβ
function earned(
address account
) public returns (uint256)
Get the aount of tokens earned by an account
Parameters:β
Name | Type | Description |
---|---|---|
account | address | that staked tokens |
Return Values:β
Name | Type | Description |
---|---|---|
amount | address | of rewards |
stakeβ
function stake(
) public returns (bool)
Stake tokens into the reward pool @param _amount amount of tokens to stake
stakeAllβ
function stakeAll(
) external returns (bool)
Stake all tokens into the reward pool.
stake the total balance up to the allowance.
stakeForβ
function stakeFor(
address _for,
uint256 _amount
) external returns (bool)
Stake for for a user that's not the sender.
tokens are transfered from msg.sender but balance is increased for _for.
Parameters:β
Name | Type | Description |
---|---|---|
_for | address | token will be staked for this account |
_amount | uint256 | the amount of token to stake |
withdrawβ
function withdraw(
uint256 amount,
bool claim
) external returns (bool)
Unstake tokens from the pool
Before unstaking the rewards for the account are updated
Parameters:β
Name | Type | Description |
---|---|---|
amount | uint256 | amount of tokens to withdraw |
claim | bool | claim the rewards |
getRewardβ
function getReward(
address _account,
bool _claimExtras
) public returns (bool)
Get rewards
Parameters:β
Name | Type | Description |
---|---|---|
_account | address | account to get rewards for |
_claimExtras | bool | claim extra rewards |
getRewardβ
function getReward(
) external returns (bool)
Get rewards for msg.sender and claim extra rewards
donateβ
function donate(
) external returns (bool)
Donate rewardToken to the pool @dev they will added to the queuedRewards and distribution will start once queueNewRewards is called. @param _amount amount of tokens to donate
queueNewRewardsβ
function queueNewRewards(
) external returns (bool)
Add some more rewards in to the pool @dev funds should be transfered before queueNewRewards is called @param _rewards amount of tokens to add to rewards