SEEDCHAIN is experimental software and these docs may get out of date quickly. Please join the Discord server for up to date information and support.

mintForToken()

mintForToken(address contractAddress, uint256 tokenId, uint256[] types, uint256[] amounts)

Payable

Mint a number of tokens for each given type against a particular NFT for an ERC721 contract.

Arguments:

  • contractAddress (address): Address of an ERC721 contract
  • tokenId (uint256): ID of a token in the provided contract
  • types (uint256): Array of impact types to mint
  • amounts (uint256): Quantity to mint for each type

Requires:

  • sender to match contractAddress or Seedchain owner. In the future, this will include deployer and owner.
  • types and amounts to be arrays of of equal size
  • Value to be sent that matches the total price for all projects. See getPrice().

Example

seedchain.mintForToken{value: price}(
    0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d, // Contract address for Bored Apes
    7537, // A token within Bored Apes
    [100], // An array containing each impact type to mint
    [1] // Quantity that we're minting for each impact type
);