I am developing NFT marketplace integrating Crossmint API now. I added crossmintPayButton to my website like the following.
import { CrossmintPayButton } from '@crossmint/client-sdk-react-ui';
...
<CrossmintPayButton
clientId="..."
environment='staging'
mintConfig={{
type: 'erc-721',
totalPrice: price * quantity,
_price: price
_quantity: quantity,
_tokenURI: tokenURI
}}
/>
How can I write mint function of contract to mint NFTs? Please, help me.
So the answer to this question is a bit involved, but I'll give you the high level. You'll want to inherit from OpenZeppelin contracts most likely to help minimize the potential mistakes.
Here is an example mint function that will work with Crossmint:
All of this code is taken from a sample starter NFT contract you can check out here: https://github.com/dmulvi/evm-721-starter
If you implement this contract you'll need to change your button code slightly to look like this: