Prerequisites
Before you can use your own smart contract with Crossmint, ensure that:- Your smart contract has a free minting function that allows Crossmint to mint NFTs without paying any fees.
- 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:- Navigate to Token collections > New Collection
- Enter the required collection information
- Select Import an existing contract
- Pick the chain, provide the contract address, and fill in the necessary information (i.e. ABI, mint function)
- 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:recipient
, which is the recipient’s wallet/email/X account user locatorscontractArguments
, 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
Best Practices
When using your own smart contract with Crossmint:- Test Thoroughly: Test your contract integration in the staging environment before moving to production.
- Function Visibility: Ensure your minting function has the appropriate visibility and access controls.
- Gas Optimization: Optimize your contract to minimize gas costs for minting operations.
- Error Handling: Implement proper error handling in your contract to provide meaningful error messages.
FAQs
Can I use an existing deployed contract?
Can I use an existing deployed contract?
Yes, you can use an existing deployed contract as long as it meets the prerequisites mentioned above.
What if my contract doesn't have a free minting function?
What if my contract doesn't have a free minting function?
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.
Can I use Crossmint's email delivery with my own contract?
Can I use Crossmint's email delivery with my own contract?
Yes, you can still use Crossmint’s email delivery system with your own contract. Just specify an email recipient
in the mint request.
How do I handle token IDs with my custom contract?
How do I handle token IDs with my custom contract?
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.