ERC1155Burnable
ERC1155Burnable allows the NFTs in the contract to be burned (transferred to a non-recoverable address).
Base Contracts Implementing This Feature
Unlocked Features
By implementing the ERC1155Mintable contract, you unlock the following features in the SDK and dashboard:
SDK Usage | Description |
---|---|
Burn NFTs | Burn a specific quantity of NFTs |
Burn Batch of NFTs | Burn a specific quantity of multiple NFTs in one transaction |
Burn From | Burn a specific quantity of NFTs from another wallet (requires permission/allowance) |
Burn Batch of NFTs From | Burn a specific quantity of NFTs |
Implementing It Yourself
This section is meant for advanced users who want to write the functionality from scratch.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/eip/ERC1155.sol";
import "@thirdweb-dev/contracts/extension/interface/IBurnableERC1155.sol";
contract Contract is ERC1155, IBurnableERC1155 {
constructor(
string memory _name,
string memory _symbol
)
ERC1155(
_name,
_symbol
)
{}
function burn(address account, uint256 id, uint256 value) external override {
// Your custom implementation here
}
function burnBatch(
address account, uint256[] memory ids, uint256[] memory values) external override {
// Your custom implementation here
}
}