Crossmint
Search…
Ethereum
Ethereum is one of the blockchains supported by Crossmint. Read on to learn how to integrate our client SDK with your Ethereum NFT drop.
Use Crossmint and allow your customers to mint NFTs with Ethereum using their credit card in less than 5 minutes.
Crossmint supports minting multiple NFTs in a single transaction. To learn more, see the integrate button section.
The default transaction limit is $750. If your mint price is higher than this or you want to support minting multiple and this would exceed the limit, please contact us at [email protected].

Pre-requisites

  • You must have yarn installed. Install yarn by following these instructions.
  • Your Crossmint Developer Account must be verified.
  • Your contract must be ERC-721 or ERC-1155 compliant. Also, it must meet our Smart Contract Requirements defined below. If you have a different contract, message us at [email protected].
See the testing section to learn more about how to test the integration before releasing to production.

Obtaining your Crossmint Client ID

To configure the Crossmint button, you will need a Crossmint Client ID. To obtain a Crossmint Client ID, sign up for an account using the Crossmint Developer Console, and register your ETH contract address.

Verifying your Crossmint Developer Account

First, visit our Crossmint Developer Console. Choose Ethereum and register your Contract Address. You'll also need to enter the following information for your drop:
Next, your Crossmint Developer Account must be verified, or else your drop won't work in production. In most cases, verification happens automatically. In very rare cases, we'll reach out to you via email to provide additional information.

Smart Contract Requirements:

To minimize gas fees for your customers, we require that your smart contract meets two criteria:
  1. 1.
    There must be a minting function that allows minting directly to another address different than the one which invoked the contract.
  2. 2.
    A single address must be able to call the mint function unlimited times, but does not need to be able to hold unlimited NFTs.
Your minting function must contain at least one parameter that specifies the recipient address to mint the NFT to. Crossmint needs a mint function that lets the caller specify a different address to mint to.
If your contract is already deployed and doesn't meet this criteria, reach out to us at [email protected].
Let's see some very minimal examples below:

Contract Minting Function Example:

function crossmint(address _to) public payable {
require(mintPrice == msg.value, "Incorrect ETH value sent");
require(_tokenIdCounter.current() + 1 <= maxSupply, "No more left");
require(msg.sender == 0xdAb1a1854214684acE522439684a145E62505233,
"This function is for Crossmint only."
);
​
uint256 newTokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
​
_safeMint(_to, newTokenId);
}
The mint function Crossmint uses can be named anything and contain any number of additional parameters as long as it meets these requirements. You can configure all parameters when minting with our client SDK.

Grabbing the ABI section for your minting function

When you compile your smart contract there will be a corresponding abi file. It'll have a .abi or .json extension depending on how you compiled your smart contract.
Inside of this file you'll see a property, abi, that's an array with various objects. You'll need to grab the specific one that corresponds to the mint function you want us to call, and enter this into the Crossmint Developer Console.
Here's an example of what your abi file will look like, but yours might have more objects.
// Example generated abi file for smart contract
{
"abi":[
{
"inputs":[
],
"stateMutability":"nonpayable",
"type":"constructor"
},
{
"inputs":[
{
"internalType":"address",
"name":"to",
"type":"address"
},
{
"internalType":"uint256",
"name":"_count",
"type":"uint256"
}
],
"name":"mintTo",
"outputs":[
],
"stateMutability":"payable",
"type":"function"
}
]
}
Next, grab the specific object that corresponds to the mint function you want Crossmint to call. To make this function easier to find you can use CTRL+F and search for the name of your function, in this case our minting function's name is mintTo.
The object below is the one that contains the information for the minting funtion we want to call. It contains all the function arguments and the type is function. In the example above's case, it would look like this:
// Example of specific section of abi file to enter into Crossmint Developer Console
{
"inputs":[
{
"internalType":"address",
"name":"to",
"type":"address"
},
{
"internalType":"uint256",
"name":"_count",
"type":"uint256"
}
],
"name":"mintTo",
"outputs":[
],
"stateMutability":"payable",
"type":"function"
}
Copy and paste that object, and paste it into the ABI section for mint function field.
Make sure the JSON is properly formatted by using a JSON validator.

Specifying a recipient address parameter for your minting function

After entering your ABI function, you will see in a dropdown all the options so you can easily choose the recipient address parameter.
Address mint function argument field
The first address field encountered will be set as default, make sure to double check it is the right one.

Specifying the parameter that indicates the number of NFTs to mint in a single transaction

If your mint function has a parameter that specifies the amount of NFTs to mint in a single transaction, select it out from the options provided after the ABI function was entered. This parameter can be named anything. For example, _count or _mintAmount are perfectly fine parameter names, just make sure it corresponds to the parameter name in your minting function.
Amount mint function argument field

Testing on Rinkeby

We support testing on Rinkeby. This will let you demo the minting process through Crossmint end-to-end with mock credit cards.
To get started, first create a test contract using our Staging Developer Console. Verification is not necessary for testing purposes.
You'll need to create a new account for the Staging Developer Console because it's separate from our primary developer console.
When you register your Contract Address in the Developer Console it can be a Rinkeby Testnet address.
Our address, 0xdAb1a1854214684acE522439684a145E62505233, is the same for testing on Rinkeby and for production on Mainnet.
When testing, use the card number 4242 4242 4242 4242. Use any three-digit CVC and a valid future date, such as 12/34.
If there's an issue with your smart contract and you have to re-compile you'll have to create a new collection in the staging developer console, re-enter the new contract address, function params, and abi, get a new client id, and update your front-end.
Next, ensure that you add the attribute environment="staging" to the Crossmint button so it works when testing.
Here's an example using our React.js Client SDK, but adding the environment attribute works in the same when using our VanillaJS SDK:
// Add this import line at the top
import { CrossmintPayButton } from "@crossmint/client-sdk-react-ui";
​
export default function Index() {
return (
<CrossmintPayButton
clientId="<YOUR_CLIENT_ID>"
environment="staging"
/>
);
}
For a more in-depth button integration example, see the Integrate button section.

Allowlists / Whitelists

We support allowlists, contact [email protected] to discuss details and get everything set up. In most cases, you can add crossmint.eth to the allowlist.

Integrate the Crossmint button

After meeting all prerequisites, you're now ready to integrate our button into your website.
We provide a variety of ways to integrate the client SDK. If you're using React.js, or Next.js we have a client integration specific for you. If you're using a different framework, or working with vanilla JavaScript, we can help you there too.

Where to mint to?

By default, Crossmint offers the creator the opportunity to decide where is the NFT going to be minted. You can either mint into the user's dedicated Crossmint wallet, or directly into their own wallet. To find out more about this, read our Direct mint to user wallet page.

Ready to dive deeper?

After you finished integrating the client SDK into your NFT drop website, there's a lot more you can do.
Learn how to customize the Crossmint button's style to fit your theme. Also, you can listen for NFT purchase events and retrieve the user wallet address using webhooks.