Linkdrop Guides
  • Introduction to Linkdrop
  • Linkdrop Dashboard
    • Creating links in bulk
      • ✨Main guide
        • Before you go
          • Supported networks
          • Token standards
          • Getting crypto to start
          • Minting 1155 NFTs on Polygon
          • Misc
        • ✨Setting up a campaign
        • Mint pattern requirements
        • Using CSV to add tokens
      • Managing a campaign
        • Adding batches to campaign
        • Pausing campaign
        • Refunding unused tokens
      • All distribution options
      • Individual QR codes
        • Viewing and generating QRs
        • Connecting QRs to claim links
      • Multi-scannable QR code
      • Using Testnets
      • Sponsorship nuances
    • Use cases
      • Add NFTs to your physical products
      • Distribute NFTs in emails.
      • Distribute NFTs with your logic
      • Run NFT based referral invite campaigns
    • Claim application
      • Claiming with wallet
        • Using Metamask
        • Other (Walletconnect)
      • Claiming by ENS or address
    • Troubleshooting
    • Dashboard SDK & API
      • Keys and installation
      • Create & manage campaigns
      • Claim methods
      • API
  • Linkdrop P2P (beta)
    • 💸P2P SDK
Powered by GitBook
On this page
  • NFT requirements to use mint pattern
  • ERC721 Mintable ABI:
  • ERC1155 Mintable ABI:
  • Please also note
  1. Linkdrop Dashboard
  2. Creating links in bulk
  3. Main guide

Mint pattern requirements

You can choose this pattern to allow your users to mint items at claim

PreviousSetting up a campaignNextUsing CSV to add tokens

Last updated 1 year ago

This option is suitable for advances users who can create their NFTs deploying their own contract. This way, when you will use the contract that follows the requirements below and select "Mint" pattern when, your NFTs will not be pre-minted, but can be minted at claim, when user will follow the claim link.

NFT requirements to use mint pattern

In order to be able to use the “mint at claim” pattern the NFT contract in addition to standard ERC721/1155 ABIs, contracts should have the functions based on OpenZeppelin Access pattern ().

ERC721 Mintable ABI:

interface IERC721Mintable {
  function safeMint(address to) external; // increments token ID for each minted token incrementally starting from 1
  function grantRole(bytes32 role, address account) external;
  function hasRole(bytes32 role, address account) public view returns (bool)
}

Please note that safeMint function doesn’t have tokenURI parameter, so metadata for ERC721 tokens should be uploaded to all tokens in advance and tokenURI function should automatically compute metadata URL by concatenating baseURI and `tokenId together.You can see an example ERC721 Mintable Contract implementation here -

ERC1155 Mintable ABI:

interface IERC1155Mintable {
 function mintTo(address account, uint256 id, string calldata tokenURI, uint256 amount) external;
 function grantRole(bytes32 role, address account) external;
 function hasRole(bytes32 role, address account) public view returns (bool)
}

When claiming ERC1155 token, Linkdrop Escrow contract will call the NFT contract's mintTo function and empty string will be passed as tokenURI. Metadata for each token id should be prepared before claim by minting 0 tokens and passing correct tokenURI for that token id. The NFT contract should respect that logic, please refer to the to learn more.

Please also note

safeMint for ERC721 and mint for ERC1155 contracts should both respect MINTER_ROLE, which is computed the following way: bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

✨
setting up a campaign
https://wizard.openzeppelin.com/#erc721
https://polygonscan.com/address/0xc5271d9Df75c0FBE241730F2Fbc9e2480359Cf77#code
Thirdweb ERC1155 implementation