Staking721

Methods

claimRewards

function claimRewards() external nonpayable

Claim accumulated rewards.

See {_claimRewards}. Override that to implement custom logic. See {_calculateRewards} for reward-calculation logic.

getRewardTokenBalance

function getRewardTokenBalance() external view returns (uint256 _rewardsAvailableInContract)

View total rewards available in the staking contract.

Returns

Name
Type
Description

_rewardsAvailableInContract

uint256

undefined

getRewardsPerUnitTime

function getRewardsPerUnitTime() external view returns (uint256 _rewardsPerUnitTime)

Returns

Name
Type
Description

_rewardsPerUnitTime

uint256

undefined

getStakeInfo

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[]

List of token-ids staked by staker.

_rewards

uint256

Available reward amount.

getTimeUnit

Returns

Name
Type
Description

_timeUnit

uint256

undefined

indexedTokens

List of token-ids ever staked.

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

_0

uint256

undefined

isIndexed

Mapping from token-id to whether it is indexed or not.

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

_0

bool

undefined

setRewardsPerUnitTime

Set rewards per unit of time. Interpreted as x rewards per second/per day/etc based on time-unit.

Only admin/authorized-account can call it.

Parameters

Name
Type
Description

_rewardsPerUnitTime

uint256

New rewards per unit time.

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

Name
Type
Description

_timeUnit

uint256

New time unit.

stake

Stake ERC721 Tokens.

See {_stake}. Override that to implement custom logic.

Parameters

Name
Type
Description

_tokenIds

uint256[]

List of tokens to stake.

stakerAddress

Mapping from staked token-id to staker address.

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

stakers

Mapping from staker address to Staker struct. See {struct IStaking721.Staker}.

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

amountStaked

uint256

undefined

timeOfLastUpdate

uint256

undefined

unclaimedRewards

uint256

undefined

conditionIdOflastUpdate

uint256

undefined

stakersArray

List of accounts that have staked their NFTs.

Parameters

Name
Type
Description

_0

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

stakingToken

Address of ERC721 NFT contract -- staked tokens belong to this contract.

Returns

Name
Type
Description

_0

address

undefined

withdraw

Withdraw staked tokens.

See {_withdraw}. Override that to implement custom logic.

Parameters

Name
Type
Description

_tokenIds

uint256[]

List of tokens to withdraw.

Events

RewardsClaimed

Parameters

Name
Type
Description

staker indexed

address

undefined

rewardAmount

uint256

undefined

TokensStaked

Parameters

Name
Type
Description

staker indexed

address

undefined

tokenIds indexed

uint256[]

undefined

TokensWithdrawn

Parameters

Name
Type
Description

staker indexed

address

undefined

tokenIds indexed

uint256[]

undefined

UpdatedRewardsPerUnitTime

Parameters

Name
Type
Description

oldRewardsPerUnitTime

uint256

undefined

newRewardsPerUnitTime

uint256

undefined

UpdatedTimeUnit

Parameters

Name
Type
Description

oldTimeUnit

uint256

undefined

newTimeUnit

uint256

undefined

Last updated