Skip to main content

ISignatureMintERC1155

The 'signature minting' mechanism used in thirdweb Token smart contracts is a way for a contract admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by that external party.

Methods

mintWithSignature

function mintWithSignature(ISignatureMintERC1155.MintRequest req, bytes signature) external payable returns (address signer)

Mints tokens according to the provided mint request.

Parameters

NameTypeDescription
reqISignatureMintERC1155.MintRequestThe payload / mint request.
signaturebytesThe signature produced by an account signing the mint request.

Returns

NameTypeDescription
signeraddressundefined

verify

function verify(ISignatureMintERC1155.MintRequest req, bytes signature) external view returns (bool success, address signer)

Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).

Parameters

NameTypeDescription
reqISignatureMintERC1155.MintRequestThe payload / mint request.
signaturebytesThe signature produced by an account signing the mint request. returns (success, signer) Result of verification and the recovered address.

Returns

NameTypeDescription
successboolundefined
signeraddressundefined

Events

TokensMintedWithSignature

event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, ISignatureMintERC1155.MintRequest mintRequest)

Emitted when tokens are minted.

Parameters

NameTypeDescription
signer indexedaddressundefined
mintedTo indexedaddressundefined
tokenIdMinted indexeduint256undefined
mintRequestISignatureMintERC1155.MintRequestundefined