ERC20Mintable
Enable the minting of new tokens by implementing ERC20
and IMintableERC20
.
Base Contracts Implementing This Feature
Unlocked Features
By implementing the ERC20
standard, you unlock the following features in the SDK and dashboard:
SDK Feature | Description |
---|---|
Mint Tokens | Permit other addresses to transfer a specified amount of tokens from your wallet. |
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/IMintableERC20.sol";
contract Contract is ERC20, IMintableERC20 {
constructor(
string memory _name,
string memory _symbol
)
ERC20(
_name,
_symbol
)
{}
function mintTo(address to, uint256 amount) external override {
// Your custom implementation here
}
}