Staking1155Upgradeable
Methods
claimRewards
Claim accumulated rewards.
See {_claimRewards}. Override that to implement custom logic. See {_calculateRewards} for reward-calculation logic.
Parameters
_tokenId
uint256
Staked token Id.
getDefaultRewardsPerUnitTime
Returns
_rewardsPerUnitTime
uint256
undefined
getDefaultTimeUnit
Returns
_timeUnit
uint256
undefined
getRewardTokenBalance
View total rewards available in the staking contract.
Returns
_rewardsAvailableInContract
uint256
undefined
getRewardsPerUnitTime
Parameters
_tokenId
uint256
undefined
Returns
_rewardsPerUnitTime
uint256
undefined
getStakeInfo
View all tokens staked and total rewards for a user.
Parameters
_staker
address
Address for which to calculated rewards.
Returns
_tokensStaked
uint256[]
List of token-ids staked.
_tokenAmounts
uint256[]
Amount of each token-id staked.
_totalRewards
uint256
Total rewards available.
getStakeInfoForToken
View amount staked and rewards for a user, for a given token-id.
Parameters
_tokenId
uint256
undefined
_staker
address
Address for which to calculated rewards.
Returns
_tokensStaked
uint256
Amount of tokens staked for given token-id.
_rewards
uint256
Available reward amount.
getTimeUnit
Parameters
_tokenId
uint256
undefined
Returns
_timeUnit
uint256
undefined
indexedTokens
List of token-ids ever staked.
Parameters
_0
uint256
undefined
Returns
_0
uint256
undefined
isIndexed
Mapping from token-id to whether it is indexed or not.
Parameters
_0
uint256
undefined
Returns
_0
bool
undefined
setDefaultRewardsPerUnitTime
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
_defaultRewardsPerUnitTime
uint256
New rewards per unit time.
setDefaultTimeUnit
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
_defaultTimeUnit
uint256
New time unit.
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
_tokenId
uint256
ERC1155 token Id.
_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
_tokenId
uint256
ERC1155 token Id.
_timeUnit
uint256
New time unit.
stake
Stake ERC721 Tokens.
See {_stake}. Override that to implement custom logic.
Parameters
_tokenId
uint256
ERC1155 token-id to stake.
_amount
uint256
Amount to stake.
stakers
Mapping from token-id and staker address to Staker struct. See {struct IStaking1155.Staker}.
Parameters
_0
uint256
undefined
_1
address
undefined
Returns
amountStaked
uint256
undefined
timeOfLastUpdate
uint256
undefined
unclaimedRewards
uint256
undefined
conditionIdOflastUpdate
uint256
undefined
stakersArray
Mapping from token-id to list of accounts that have staked that token-id.
Parameters
_0
uint256
undefined
_1
uint256
undefined
Returns
_0
address
undefined
stakingToken
Address of ERC1155 contract -- staked tokens belong to this contract.
Returns
_0
address
undefined
withdraw
Withdraw staked tokens.
See {_withdraw}. Override that to implement custom logic.
Parameters
_tokenId
uint256
ERC1155 token-id to withdraw.
_amount
uint256
Amount to withdraw.
Events
Initialized
Parameters
version
uint8
undefined
RewardsClaimed
Parameters
staker indexed
address
undefined
rewardAmount
uint256
undefined
TokensStaked
Parameters
staker indexed
address
undefined
tokenId indexed
uint256
undefined
amount
uint256
undefined
TokensWithdrawn
Parameters
staker indexed
address
undefined
tokenId indexed
uint256
undefined
amount
uint256
undefined
UpdatedDefaultRewardsPerUnitTime
Parameters
oldRewardsPerUnitTime
uint256
undefined
newRewardsPerUnitTime
uint256
undefined
UpdatedDefaultTimeUnit
Parameters
oldTimeUnit
uint256
undefined
newTimeUnit
uint256
undefined
UpdatedRewardsPerUnitTime
Parameters
_tokenId indexed
uint256
undefined
oldRewardsPerUnitTime
uint256
undefined
newRewardsPerUnitTime
uint256
undefined
UpdatedTimeUnit
Parameters
_tokenId indexed
uint256
undefined
oldTimeUnit
uint256
undefined
newTimeUnit
uint256
undefined
Last updated