IStaking20
thirdweb
Methods
claimRewards
function claimRewards() external nonpayable
Claim accumulated rewards.
getStakeInfo
function getStakeInfo(address staker) external view returns (uint256 _tokensStaked, uint256 _rewards)
View amount staked and total rewards for a user.
Parameters
Name | Type | Description |
---|---|---|
staker | address | Address for which to calculated rewards. |
Returns
Name | Type | Description |
---|---|---|
_tokensStaked | uint256 | undefined |
_rewards | uint256 | undefined |
stake
function stake(uint256 amount) external payable
Stake ERC721 Tokens.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to stake. |
withdraw
function withdraw(uint256 amount) external nonpayable
Withdraw staked tokens.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to withdraw. |
Events
RewardsClaimed
event RewardsClaimed(address indexed staker, uint256 rewardAmount)
Emitted when a staker claims staking rewards.
Parameters
Name | Type | Description |
---|---|---|
staker indexed | address | undefined |
rewardAmount | uint256 | undefined |
TokensStaked
event TokensStaked(address indexed staker, uint256 amount)
Emitted when tokens are staked.
Parameters
Name | Type | Description |
---|---|---|
staker indexed | address | undefined |
amount | uint256 | undefined |
TokensWithdrawn
event TokensWithdrawn(address indexed staker, uint256 amount)
Emitted when a tokens are withdrawn.
Parameters
Name | Type | Description |
---|---|---|
staker indexed | address | undefined |
amount | uint256 | undefined |
UpdatedMinStakeAmount
event UpdatedMinStakeAmount(uint256 oldAmount, uint256 newAmount)
Emitted when contract admin updates minimum staking amount.
Parameters
Name | Type | Description |
---|---|---|
oldAmount | uint256 | undefined |
newAmount | uint256 | undefined |
UpdatedRewardRatio
event UpdatedRewardRatio(uint256 oldNumerator, uint256 newNumerator, uint256 oldDenominator, uint256 newDenominator)
Emitted when contract admin updates rewardsPerUnitTime.
Parameters
Name | Type | Description |
---|---|---|
oldNumerator | uint256 | undefined |
newNumerator | uint256 | undefined |
oldDenominator | uint256 | undefined |
newDenominator | uint256 | undefined |
UpdatedTimeUnit
event UpdatedTimeUnit(uint256 oldTimeUnit, uint256 newTimeUnit)
Emitted when contract admin updates timeUnit.
Parameters
Name | Type | Description |
---|---|---|
oldTimeUnit | uint256 | undefined |
newTimeUnit | uint256 | undefined |