Optional
roles: ContractRoles<TokenERC20, "transfer" | "minter" | "admin">Private
contractMint tokens from a signature
Rest
...args: [signedPayload: SignedPayload20]Mint a certain amount of tokens from a previously generated signature.
// see how to craft a payload to sign in the `generate()` documentation
const signedPayload = contract.erc20.signature.generate(payload);
// Use the signed payload to mint the tokens
const tx = contract.erc20.signature.mint(signedPayload);
ERC20SignatureMintable
Rest
...args: [signedPayload: SignedPayload20]Mint any number of generated tokens signatures at once
Rest
...args: [signedPayloads: SignedPayload20[]]Mint multiple token signatures in one transaction. Note that this is only possible for free mints (cannot batch mints with a price attached to it for security reasons)
ERC20SignatureMintable
Rest
...args: [signedPayloads: SignedPayload20[]]Private
rolesGenerate a signature that can be used to mint a certain amount of tokens
the payload to sign
Optional
currencyOptional
mintOptional
mintOptional
price?: string | numberOptional
primaryOptional
uid?: stringthe signed payload and the corresponding signature
Takes in a quantity of tokens, some conditions for how it can be minted and signs it with your private key. The generated signature can then be used to mint those tokens using the exact payload and signature generated.
const startTime = new Date();
const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const payload = {
quantity: 4.2, // The quantity of tokens to be minted
to: {{wallet_address}}, // Who will receive the tokens
price: 0.5, // the price to pay for minting those tokens
currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with
mintStartTime: startTime, // can mint anytime from now
mintEndTime: endTime, // to 24h from now,
primarySaleRecipient: "0x...", // custom sale recipient for this token mint
};
const signedPayload = await contract.erc20.signature.generate(payload);
// now anyone can use these to mint the NFT using `contract.erc20.signature.mint(signedPayload)`
ERC20SignatureMintable
Generate a batch of signatures that can be used to mint many token signatures.
the payloads to sign
an array of payloads and signatures
Verify that a payload is correctly signed
the payload to verify
ERC20SignatureMintable
const startTime = new Date();
const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const payload = {
quantity: 4.2, // The quantity of tokens to be minted
to: {{wallet_address}}, // Who will receive the tokens
price: 0.5, // the price to pay for minting those tokens
currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with
mintStartTime: startTime, // can mint anytime from now
mintEndTime: endTime, // to 24h from now,
primarySaleRecipient: "0x...", // custom sale recipient for this token mint
};
const signedPayload = await contract.erc20.signature.generate(payload);
// Now you can verify if the signed payload is valid
const isValid = await contract.erc20.signature.verify(signedPayload);
Generated using TypeDoc
Enables generating ERC20 Tokens with rules and an associated signature, which can then be minted by anyone securely