Skip to main content

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

NameTypeDescription
stakeraddressAddress for which to calculated rewards.

Returns

NameTypeDescription
_tokensStakeduint256undefined
_rewardsuint256undefined

stake

function stake(uint256 amount) external payable

Stake ERC721 Tokens.

Parameters

NameTypeDescription
amountuint256Amount to stake.

withdraw

function withdraw(uint256 amount) external nonpayable

Withdraw staked tokens.

Parameters

NameTypeDescription
amountuint256Amount to withdraw.

Events

RewardsClaimed

event RewardsClaimed(address indexed staker, uint256 rewardAmount)

Emitted when a staker claims staking rewards.

Parameters

NameTypeDescription
staker indexedaddressundefined
rewardAmountuint256undefined

TokensStaked

event TokensStaked(address indexed staker, uint256 amount)

Emitted when tokens are staked.

Parameters

NameTypeDescription
staker indexedaddressundefined
amountuint256undefined

TokensWithdrawn

event TokensWithdrawn(address indexed staker, uint256 amount)

Emitted when a tokens are withdrawn.

Parameters

NameTypeDescription
staker indexedaddressundefined
amountuint256undefined

UpdatedMinStakeAmount

event UpdatedMinStakeAmount(uint256 oldAmount, uint256 newAmount)

Emitted when contract admin updates minimum staking amount.

Parameters

NameTypeDescription
oldAmountuint256undefined
newAmountuint256undefined

UpdatedRewardRatio

event UpdatedRewardRatio(uint256 oldNumerator, uint256 newNumerator, uint256 oldDenominator, uint256 newDenominator)

Emitted when contract admin updates rewardsPerUnitTime.

Parameters

NameTypeDescription
oldNumeratoruint256undefined
newNumeratoruint256undefined
oldDenominatoruint256undefined
newDenominatoruint256undefined

UpdatedTimeUnit

event UpdatedTimeUnit(uint256 oldTimeUnit, uint256 newTimeUnit)

Emitted when contract admin updates timeUnit.

Parameters

NameTypeDescription
oldTimeUnituint256undefined
newTimeUnituint256undefined