Skip to main content

IStaking721

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
_tokensStakeduint256[]undefined
_rewardsuint256undefined

stake

function stake(uint256[] tokenIds) external nonpayable

Stake ERC721 Tokens.

Parameters

NameTypeDescription
tokenIdsuint256[]List of tokens to stake.

withdraw

function withdraw(uint256[] tokenIds) external nonpayable

Withdraw staked tokens.

Parameters

NameTypeDescription
tokenIdsuint256[]List of tokens 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[] indexed tokenIds)

Emitted when a set of token-ids are staked.

Parameters

NameTypeDescription
staker indexedaddressundefined
tokenIds indexeduint256[]undefined

TokensWithdrawn

event TokensWithdrawn(address indexed staker, uint256[] indexed tokenIds)

Emitted when a set of staked token-ids are withdrawn.

Parameters

NameTypeDescription
staker indexedaddressundefined
tokenIds indexeduint256[]undefined

UpdatedRewardsPerUnitTime

event UpdatedRewardsPerUnitTime(uint256 oldRewardsPerUnitTime, uint256 newRewardsPerUnitTime)

Emitted when contract admin updates rewardsPerUnitTime.

Parameters

NameTypeDescription
oldRewardsPerUnitTimeuint256undefined
newRewardsPerUnitTimeuint256undefined

UpdatedTimeUnit

event UpdatedTimeUnit(uint256 oldTimeUnit, uint256 newTimeUnit)

Emitted when contract admin updates timeUnit.

Parameters

NameTypeDescription
oldTimeUnituint256undefined
newTimeUnituint256undefined