How to Airdrop ERC721 NFTs to a List of Wallet Addresses

How to Airdrop ERC721 NFTs to a List of Wallet Addresses - thirdweb Guides

In this guide, we will show you how to airdrop NFTs to a list of recipients using the new Airdrop ERC721 smart contract!

If you don't already have an NFT collection, you can deploy one using our guide on how to create an NFT collection before getting started.

Let's dive into it!

Deploy the Airdrop Contract

To begin, let's deploy our Airdrop contract. Head to the Explore page and click on the Airdrop ERC-721 contract. Click Deploy Now to start the deployment flow:

Deploy Airdrop ERC721 contract
Deploy Airdrop ERC721 contract

Enter the wallet address you want to be the owner of the contract, select the same network that your NFT collection contract is deployed to, and click Deploy Now.

Add admin of the contract and click deploy
Add admin of the contract and click deploy

Approve the transaction to deploy your smart contract. After a successful deployment, you will be taken to the generated dashboard for your airdrop contract!

Set Approval For Tokens

In order for the smart contract to be able to airdrop NFTs to users, it requires approval to transfer those NFTs from your wallet (from this collection).

To do that, you need to run the setApprovalForAll function on your NFT collection smart contract; with the operator set to your airdrop smart contract address.

Set Approval for Tokens
Set Approval for Tokens

Airdropping NFTs

Back in the Airdrop contract, head to the Explorer tab and use the airdrop function with the following parameters:

  • _tokenAddress: The address of the NFT collection smart contract.
  • _tokenOwner: The wallet address that contains the NFTs to be transferred (the wallet we just ran approve from in the step above).
  • _recipients: The list of recipients of the airdrop.
  • Token Ids: The token IDs of the NFTs you want to airdrop.

For example, in the screenshot below, wallet 0xa9D will receive token ID 4 and wallet 0x528 will receive token ID 5.

Add the details for airdropping the tokens
Add the details for airdropping the tokens

After executing the function, approve a transaction and the airdrop will be successfully completed! 🛩ī¸

Conclusion

In this guide, we learned how we can airdrop our NFTs to different wallets using the dashboard. If you run into any issues while following this guide, feel free to reach out to us on our Discord server to speak to our team directly!