ERC1155SignatureMint
The SignatureMintERC1155 smart contract is an extension meant for distributing ERC1155 tokens.
The 'signature minting' mechanism in the SignatureMintERC1155 extension uses EIP-712, and 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.
View on GitHub
The SignatureMintERC1155 extension is an abstract contract, and expects you to implement the following functions by yourself:
| Name | Type | Description | 
|---|---|---|
| _canSignMintRequest | internal view virtual | Runs on every attempt to mint tokens with signature on the contract. Returns whether the signer is authorized to issue a signature for minting. | 
| mintWithSignature | external payable | Mints tokens according to the provided mint request. | 
This is an example smart contract demonstrating how to inherit from this extension and override the functions to add (optional) custom functionality.
- Verifies that a mint request is valid and signed by an authorized wallet.
- Parameter req: The mint request.- to: The recipient of the tokens to mint.
- royaltyRecipient: The recipient of the minted token's secondary sales royalties.
- royaltyBps: The percentage of the minted token's secondary sales to take as royalties.
- primarySaleRecipient: The recipient of the minted token's primary sales proceeds.
- tokenId: The tokenId of the NFT to mint.
- uri: The metadata URI of the token to mint.
- quantity: The quantity of tokens to mint.
- pricePerToken: The price to pay per quantity of tokens minted.
- currency: The currency in which to pay the price per token minted.
- validityStartTimestamp: The unix timestamp after which the payload is valid.
- validityEndTimestamp: The unix timestamp at which the payload expires.
- uid: A unique identifier for the payload.
 
- Parameter signature: The signature produced by an authorized wallet signing the mint request.
- Mints tokens according to the provided mint request.
- Parameter req: The mint request.- to: The recipient of the tokens to mint.
- royaltyRecipient: The recipient of the minted token's secondary sales royalties.
- royaltyBps: The percentage of the minted token's secondary sales to take as royalties.
- primarySaleRecipient: The recipient of the minted token's primary sales proceeds.
- tokenId: The tokenId of the NFT to mint.
- uri: The metadata URI of the token to mint.
- quantity: The quantity of tokens to mint.
- pricePerToken: The price to pay per quantity of tokens minted.
- currency: The currency in which to pay the price per token minted.
- validityStartTimestamp: The unix timestamp after which the payload is valid.
- validityEndTimestamp: The unix timestamp at which the payload expires.
- uid: A unique identifier for the payload.
 
- Parameter signature: The signature produced by an authorized wallet signing the mint request.
- Verifies a mint request and marks the request and signature as used.
- Parameter req: The mint request.- to: The recipient of the tokens to mint.
- royaltyRecipient: The recipient of the minted token's secondary sales royalties.
- royaltyBps: The percentage of the minted token's secondary sales to take as royalties.
- primarySaleRecipient: The recipient of the minted token's primary sales proceeds.
- tokenId: The tokenId of the NFT to mint.
- uri: The metadata URI of the token to mint.
- quantity: The quantity of tokens to mint.
- pricePerToken: The price to pay per quantity of tokens minted.
- currency: The currency in which to pay the price per token minted.
- validityStartTimestamp: The unix timestamp after which the payload is valid.
- validityEndTimestamp: The unix timestamp at which the payload expires.
- uid: A unique identifier for the payload.
 
- Parameter signature: The signature produced by an authorized wallet signing the mint request.
- Returns the address of the signer of the mint request.
- Parameter req: The mint request.- to: The recipient of the tokens to mint.
- royaltyRecipient: The recipient of the minted token's secondary sales royalties.
- royaltyBps: The percentage of the minted token's secondary sales to take as royalties.
- primarySaleRecipient: The recipient of the minted token's primary sales proceeds.
- tokenId: The tokenId of the NFT to mint.
- uri: The metadata URI of the token to mint.
- quantity: The quantity of tokens to mint.
- pricePerToken: The price to pay per quantity of tokens minted.
- currency: The currency in which to pay the price per token minted.
- validityStartTimestamp: The unix timestamp after which the payload is valid.
- validityEndTimestamp: The unix timestamp at which the payload expires.
- uid: A unique identifier for the payload.
 
- Parameter signature: The signature produced by an authorized wallet signing the mint request.
- Returns whether a given address is authorized to sign mint requests.
- Parameter signer: the address that the contract checks is eligible to sign mint requests, or not.