In this project, we bring together our learning to create a Candy Machine UI for the Candy Machine NFT Contract deployed and minted on Solana. The twist? Users will pay in a custom SPL token to mint NFTs.
To accomplish this assignment, we'll go through the following steps:
- Create an SPL Token: Utilize lessons learned or use a previously created SPL token.
- Update Config: Adjust
config.json
to use the SPL token's address. - Create Candy Machine UI: Follow the tutorial in Quick Node: Set Up a Minting Site to set up the UI.
- Fix Start Script: Change the start script in
package.json
to prevent anERR_OSSL_EVP_UNSUPPORTED
error."start": "export SET NODE_OPTIONS=--openssl-legacy-provider && craco start"
- Run the UI: Ensure users can mint NFTs by paying with the custom SPL token.
For the config.json
file:
- The
splToken
= mint token address - The
splTokenAccount
= The token address that will recieve the minted token and holds its quantity amount - The
creator.address
= The owner's address
Create a new SPL token or utilize an existing one.
In config.json
, modify the splTokenAddress
to reflect the address of the SPL token created in Step 1.
Follow the tutorial here to create a UI for the Candy Machine. Note the adjustment required for the start script.
Change the start script in package.json
as mentioned above to avoid ERR_OSSL_EVP_UNSUPPORTED
error during UI startup.
Ensure the Candy Machine UI is running smoothly, and users can mint NFTs by paying with the custom SPL token.
- Test thoroughly by transferring or minting the SPL token to a Phantom account and attempting to mint NFTs on the website.
- Consider adjusting the mint function in the SPL project to mint to your Phantom address or modifying the transfer function to transfer to your Phantom wallet.
Let's make this candy machine project a success! 🍬🚀