Staking20Upgradeable
Methods
claimRewards
Claim accumulated rewards.
See {_claimRewards}. Override that to implement custom logic. See {_calculateRewards} for reward-calculation logic.
getRewardRatio
Returns
_numerator
uint256
undefined
_denominator
uint256
undefined
getRewardTokenBalance
View total rewards available in the staking contract.
Returns
_rewardsAvailableInContract
uint256
undefined
getStakeInfo
View amount staked and rewards for a user.
Parameters
_staker
address
Address for which to calculated rewards.
Returns
_tokensStaked
uint256
Amount of tokens staked.
_rewards
uint256
Available reward amount.
getTimeUnit
Returns
_timeUnit
uint256
undefined
rewardTokenDecimals
Decimals of reward token.
Returns
_0
uint256
undefined
setRewardRatio
Set rewards per unit of time. Interpreted as (numerator/denominator) rewards per second/per day/etc based on time-unit. For e.g., ratio of 1/20 would mean 1 reward token for every 20 tokens staked.
Only admin/authorized-account can call it.
Parameters
_numerator
uint256
Reward ratio numerator.
_denominator
uint256
Reward ratio denominator.
setTimeUnit
Set time unit. Set as a number of seconds. Could be specified as -- x * 1 hours, x * 1 days, etc.
Only admin/authorized-account can call it.
Parameters
_timeUnit
uint256
New time unit.
stake
Stake ERC20 Tokens.
See {_stake}. Override that to implement custom logic.
Parameters
_amount
uint256
Amount to stake.
stakers
Mapping staker address to Staker struct. See {struct IStaking20.Staker}.
Parameters
_0
address
undefined
Returns
amountStaked
uint256
undefined
timeOfLastUpdate
uint256
undefined
unclaimedRewards
uint256
undefined
conditionIdOflastUpdate
uint256
undefined
stakersArray
List of accounts that have staked that token-id.
Parameters
_0
uint256
undefined
Returns
_0
address
undefined
stakingToken
Address of ERC20 contract -- staked tokens belong to this contract.
Returns
_0
address
undefined
stakingTokenBalance
Total amount of tokens staked in the contract.
Returns
_0
uint256
undefined
stakingTokenDecimals
Decimals of staking token.
Returns
_0
uint256
undefined
withdraw
Withdraw staked ERC20 tokens.
See {_withdraw}. Override that to implement custom logic.
Parameters
_amount
uint256
Amount to withdraw.
Events
Initialized
Parameters
version
uint8
undefined
RewardsClaimed
Parameters
staker indexed
address
undefined
rewardAmount
uint256
undefined
TokensStaked
Parameters
staker indexed
address
undefined
amount
uint256
undefined
TokensWithdrawn
Parameters
staker indexed
address
undefined
amount
uint256
undefined
UpdatedMinStakeAmount
Parameters
oldAmount
uint256
undefined
newAmount
uint256
undefined
UpdatedRewardRatio
Parameters
oldNumerator
uint256
undefined
newNumerator
uint256
undefined
oldDenominator
uint256
undefined
newDenominator
uint256
undefined
UpdatedTimeUnit
Parameters
oldTimeUnit
uint256
undefined
newTimeUnit
uint256
undefined
Last updated