Skip to main content

EcdPtpRewardPool

Functions​

totalSupply​

  function totalSupply(
) public returns (uint256)

The sum of all the staked tokens

Return Values:​

NameTypeDescription
_totalSupplyThe total supply

balanceOf​

  function balanceOf(
) public returns (uint256)

Balance of staked tokens for a user

Return Values:​

NameTypeDescription
Balanceaddressof the user

extraRewardsLength​

  function extraRewardsLength(
) external returns (uint256)

Get the number of extraRewards

Return Values:​

NameTypeDescription
theextraRewards length

setEmissionRate​

  function setEmissionRate(
uint256 _emissionRate
) external

Queue a new emission rate

Parameters:​

NameTypeDescription
_emissionRateuint256new 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:​

NameTypeDescription
atimestamp

rewardPerToken​

  function rewardPerToken(
) public returns (uint256)

Returns the amount of rewards per staked token.

Return Values:​

NameTypeDescription
amountof rewards

earned​

  function earned(
address account
) public returns (uint256)

Get the aount of tokens earned by an account

Parameters:​

NameTypeDescription
accountaddressthat staked tokens

Return Values:​

NameTypeDescription
amountaddressof 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:​

NameTypeDescription
_foraddresstoken will be staked for this account
_amountuint256the 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:​

NameTypeDescription
amountuint256amount of tokens to withdraw
claimboolclaim the rewards

getReward​

  function getReward(
address _account,
bool _claimExtras
) public returns (bool)

Get rewards

Parameters:​

NameTypeDescription
_accountaddressaccount to get rewards for
_claimExtrasboolclaim extra rewards

getReward​

  function getReward(
) external returns (bool)

Get rewards for msg.sender and claim extra rewards

  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

Events​