ERC20Burnable
Support burning tokens by implementing the IBurnableERC20
interface.
Base Contracts Implementing This Feature
No base contracts implement this functionality by default.
Unlocked Features
By implementing the ERC20
standard, you unlock the following features in the SDK and dashboard:
SDK Feature | Description |
---|---|
Burn Tokens | Burn a specified amount of tokens. |
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/openzeppelin-presets/token/ERC20/ERC20.sol";
import "@thirdweb-dev/contracts/extension/interface/IBurnableERC20.sol";
contract Contract is ERC20, IBurnableERC20 {
constructor(
string memory _name,
string memory _symbol
)
ERC20(
_name,
_symbol
)
{}
function burn(uint256 amount) external override {
// Your custom implementation here
}
function burnFrom(address account, uint256 amount) external override {
// Your custom implementation here
}
}