Docs

ERC721SignatureMintable

Allows you to utilize signature-based minting of NFTs.

Generate

Generate a signature that a wallet address can use to mint the specified number of NFTs.

This is typically an admin operation, where the owner of the contract generates a signature that allows another wallet to mint tokens.

NFTMetadata meta = new NFTMetadata()
{
name = "Unity NFT",
description = "Minted From Unity",
image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc",
};
var receiverAddress = "{{wallet_address}}";
var payload = new ERC721MintPayload(receiverAddress, meta);
var signedPayload = await contract.ERC721.Signature.Generate(payload);

Mint

Mint tokens from a previously generated signature (see generate).

NFTMetadata meta = new NFTMetadata()
{
name = "Unity NFT",
description = "Minted From Unity",
image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc",
};
var receiverAddress = "{{wallet_address}}";
var payload = new ERC721MintPayload(receiverAddress, meta);
var signedPayload = await contract.ERC721.Signature.Generate(payload);
var data = await contract.ERC721.Signature.Mint(signedPayload);

Verify

Verify that a payload is correctly signed.

This allows you to provide a payload, and prove that it was valid and was generated by a wallet with permission to generate signatures.

If a payload is not valid, the mint function will fail, but you can use this function to verify that the payload is valid before attempting to mint the tokens if you want to show a more user-friendly error message.

NFTMetadata meta = new NFTMetadata()
{
name = "Unity NFT",
description = "Minted From Unity",
image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc",
};
var receiverAddress = "{{wallet_address}}";
var payload = new ERC721MintPayload(receiverAddress, meta);
var signedPayload = await contract.ERC721.Signature.Generate(payload);
bool isValid = await contract.ERC721.Signature.Verify(signedPayload);