Staking721Base
note: This contract is provided as a base contract.
Methods
claimRewards
Claim accumulated rewards.
See {_claimRewards}. Override that to implement custom logic. See {_calculateRewards} for reward-calculation logic.
contractURI
Returns the contract metadata URI.
Returns
_0
string
undefined
depositRewardTokens
Admin deposits reward tokens.
Parameters
_amount
uint256
undefined
getRewardTokenBalance
View total rewards available in the staking contract.
Returns
_0
uint256
undefined
getRewardsPerUnitTime
Returns
_rewardsPerUnitTime
uint256
undefined
getStakeInfo
View amount staked and total rewards for a user.
Parameters
_staker
address
Address for which to calculated rewards.
Returns
_tokensStaked
uint256[]
List of token-ids staked by staker.
_rewards
uint256
Available reward amount.
getTimeUnit
Returns
_timeUnit
uint256
undefined
indexedTokens
Parameters
_0
uint256
undefined
Returns
_0
uint256
undefined
isIndexed
Parameters
_0
uint256
undefined
Returns
_0
bool
undefined
multicall
Receives and executes a batch of function calls on this contract.
Receives and executes a batch of function calls on this contract.
Parameters
data
bytes[]
The bytes data that makes up the batch of function calls to execute.
Returns
results
bytes[]
The bytes data that makes up the result of the batch of function calls executed.
nativeTokenWrapper
The address of the native token wrapper contract.
Returns
_0
address
undefined
onERC721Received
Parameters
_0
address
undefined
_1
address
undefined
_2
uint256
undefined
_3
bytes
undefined
Returns
_0
bytes4
undefined
owner
Returns the owner of the contract.
Returns
_0
address
undefined
rewardToken
ERC20 Reward Token address. See {_mintRewards} below.
Returns
_0
address
undefined
setContractURI
Lets a contract admin set the URI for contract-level metadata.
Caller should be authorized to setup contractURI, e.g. contract admin. See {_canSetContractURI}. Emits {ContractURIUpdated Event}.
Parameters
_uri
string
keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
setOwner
Lets an authorized wallet set a new owner for the contract.
Parameters
_newOwner
address
The address to set as the new owner of the contract.
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
_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
_timeUnit
uint256
New time unit.
stake
Stake ERC721 Tokens.
See {_stake}. Override that to implement custom logic.
Parameters
_tokenIds
uint256[]
List of tokens to stake.
stakerAddress
Parameters
_0
uint256
undefined
Returns
_0
address
undefined
stakers
Parameters
_0
address
undefined
Returns
amountStaked
uint256
undefined
timeOfLastUpdate
uint256
undefined
unclaimedRewards
uint256
undefined
conditionIdOflastUpdate
uint256
undefined
stakersArray
Parameters
_0
uint256
undefined
Returns
_0
address
undefined
stakingToken
Returns
_0
address
undefined
supportsInterface
See {IERC165-supportsInterface}.
Parameters
interfaceId
bytes4
undefined
Returns
_0
bool
undefined
withdraw
Withdraw staked tokens.
See {_withdraw}. Override that to implement custom logic.
Parameters
_tokenIds
uint256[]
List of tokens to withdraw.
withdrawRewardTokens
Admin can withdraw excess reward tokens.
Parameters
_amount
uint256
undefined
Events
ContractURIUpdated
Parameters
prevURI
string
undefined
newURI
string
undefined
OwnerUpdated
Parameters
prevOwner indexed
address
undefined
newOwner indexed
address
undefined
RewardsClaimed
Parameters
staker indexed
address
undefined
rewardAmount
uint256
undefined
TokensStaked
Parameters
staker indexed
address
undefined
tokenIds indexed
uint256[]
undefined
TokensWithdrawn
Parameters
staker indexed
address
undefined
tokenIds indexed
uint256[]
undefined
UpdatedRewardsPerUnitTime
Parameters
oldRewardsPerUnitTime
uint256
undefined
newRewardsPerUnitTime
uint256
undefined
UpdatedTimeUnit
Parameters
oldTimeUnit
uint256
undefined
newTimeUnit
uint256
undefined
Last updated