Skip to main content
Crossmint allows you to use your own smart contract while leveraging our infrastructure for minting NFTs. This guide will walk you through the process of integrating your custom smart contract with Crossmint.

Prerequisites

Before you can use your own smart contract with Crossmint, ensure that:
  1. Your smart contract has a free minting function that allows Crossmint to mint NFTs without paying any fees.
  2. Your smart contract complies with the ERC721 standard (for NFTs) or ERC1155 standard (for SFTs).
Currently, this feature is only available for EVM chains. Support for Solana and other chains is coming soon.

Integration Guide

1. Register Your Smart Contract

First, you need to register your smart contract at the Crossmint Console:
  1. Navigate to Token collections > New Collection
  2. Enter the required collection information
  3. Select Import an existing contract
  4. Pick the chain, provide the contract address, and fill in the necessary information (i.e. ABI, mint function)
  5. Keep track of the Crossmint collection ID generated for future mint calls

2. Contract Review

After registering your contract, the Crossmint team will review it to ensure compatibility with our infrastructure. This typically takes 1-2 business days.
During the review process, we’ll verify that your contract has the necessary free minting function and complies with the required standards.

3. Mint NFTs

Once your contract is approved, you can start minting NFTs using Crossmint’s Mint API and passing the following:
  1. recipient, which is the recipient’s wallet/email/X account user locators
  2. contractArguments, which is an object where the keys are the argument names from the mint function, and the values are their values. Omit the recipient argument from this object
cURL
curl --request POST \
  --url https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "recipient": "polygon-amoy:0x123...",
  "contractArguments": {
    "tokenId": "42"
  }
}'

Best Practices

When using your own smart contract with Crossmint:
  1. Test Thoroughly: Test your contract integration in the staging environment before moving to production.
  2. Function Visibility: Ensure your minting function has the appropriate visibility and access controls.
  3. Gas Optimization: Optimize your contract to minimize gas costs for minting operations.
  4. Error Handling: Implement proper error handling in your contract to provide meaningful error messages.

FAQs

Yes, you can use an existing deployed contract as long as it meets the prerequisites mentioned above.
Your contract must have a function that allows Crossmint to mint NFTs without paying any fees. If your contract doesn’t have this, you’ll need to modify it or deploy a new version.
Yes, you can still use Crossmint’s email delivery system with your own contract. Just specify an email recipient in the mint request.
Token ID management depends on your contract implementation. You can either pass a specific token ID as a parameter or let your contract handle token ID assignment internally.
I