Skip to main content

ERC20SignatureMint

Enable signature-based minting of tokens in your smart contract by implementing ERC20SignatureMint.

Base Contracts Implementing This Feature

Unlocked Features

By implementing the ERC20 standard, you unlock the following features in the SDK and dashboard:

SDK FeatureDescription
Signature-Based MintingGenerate signatures that allow other wallets can use to mint NFTs into your collection.

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/SignatureMintERC20.sol";

contract Contract is ERC20, SignatureMintERC20 {
constructor(
string memory _name,
string memory _symbol
)
ERC20(
_name,
_symbol
)
{}

function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
// Your custom implementation here
}

function mintWithSignature(
MintRequest calldata _req,
bytes calldata _signature
) external payable virtual override returns (address signer) {
// Your custom implementation here
}
}