Staking ERC1155 Base
import "@thirdweb-dev/contracts/base/Staking1155Base.sol";
The Staking1155Base
smart contract implements an NFT staking mechanism for ERC1155. It allows composition of an ERC1155 NFT Collection and an ERC20 Token contract into a staking mechanism.
The base contract provides an implementation of staking logic. Contract admins can implement their own reward mechanisms by overriding existing functions.
Detected Extensions
Once deployed, you can use the features made available by these extensions on the SDK and dashboard:
Click on each feature to learn more about what functions are available.
Usage
Import the contract and inherit from it.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/base/Staking1155Base.sol";
contract MyContract is Staking1155Base {
constructor(
address _defaultAdmin,
uint256 _defaultTimeUnit,
uint256 _defaultRewardsPerUnitTime,
address _stakingToken,
address _rewardToken,
address _nativeTokenWrapper
) Staking1155Base(_defaultAdmin, _defaultTimeUnit, _defaultRewardsPerUnitTime, _stakingToken, _rewardToken, _nativeTokenWrapper) {}
}
Functions to Override
The following functions have been implemented on this contract & are available to be overridden to add custom logic: