Create an NFT Minting Farcaster Frame on Degen Chain
In this guide, learn how to create a Farcaster Frame that users can mint NFTs from on Degen Chain gaslessly — airdropping the NFTs to their wallets without them needing to bridge funds to Degen Chain.
Here's the link to the GitHub repo:
Video Tutorial
Deploying your NFT minting contract
Before getting into the Farcaster Frame setup, you need to have an NFT smart contract that you can add to your frame.
With thirdweb, you can deploy pre-built, audited smart contracts to any EVM chain. For the purpose of this guide, we'll be deploying an NFT Drop (ERC-721) smart contract to Degen Chain.
To deploy your NFT Drop (ERC-721) smart contract, simply hit "Deploy now" below and select Degen Chain in the modal that opens up:
Getting Started
1. Get a Neynar API key (See the Neynar docs for more info)
2. Get a thirdweb Engine API key & create an Engine instance
3. Retrieve your thirdweb Engine URL, wallet, and access token. Set up your config.ts
file as such:
We also have a .env.example
file to get you started faster:
4. Replace <next_js_image_path>
to what you'd like to have in your code.
Each part on the Mint API here:
Just make sure it’s related to your next.js image path, usually it’s in the public
folder.
Here are the different steps:
- Get started
- Like & re-cast to mint (Neynar)
- Mint NFT (thirdweb Engine)
- Congratulations for minting
Here is some back-up HTML as well in case of something fails:
5. Change the public URL that you want the Farcaster Frame to send a response to here:
In this example, we just use Vercel's URL when doing preview and production deployments.
6. After you have everything set up — including your Neynar API key, thirdweb Engine, and the config file — you're ready to go! Please also make sure to test your api/mint
locally.
7. Go to the Farcaster Frame validator to test how users will interact with your frame: https://warpcast.com/~/developers/frames
You'll be able to see what it will look like once you publish the cast to production.
And that's it — have fun!
Learn more
The thirdweb Frame API uses thirdweb Engine to send onchain transactions with a simple fetch request.
With thirdweb Engine, you can scale your app to millions of users with backend wallet & nonce management, gas fee optimization, automatic retries, and more.
Get started with thirdweb Engine: