Airdrop an NFT from your Saga Chainlet

Kyle
Sagaxyz
Published in
5 min readJun 10, 2024

Airdrops have emerged as a pivotal mechanism in the web3 ecosystem, playing a crucial role in fostering user engagement, marketing, and decentralization. By distributing free tokens to a wide audience, airdrops effectively introduce new users to blockchain projects, driving awareness and community growth. In this tutorial, we will show you easy ways to airdrop your own NFT from your Saga Chainlet.

In this tutorial, we will:

  1. Add a Saga Chainlet to the Thirdweb platform
  2. MInt an NFT
  3. Deploy an Airdrop Contract

Requirements

Before you get started with the tutorial, make sure you have the following ready.

  • Saga Chainlet: We will deploy the ERC20 token using the Saga Chainlet. Ensure you have an active chainlet. Use this guide to launch your chainlet. The RPC endpoint and Chainlet ID will be available in your Chainlet dashboard.
  • Metamask Wallet: For this tutorial, we will use the Metamask wallet. You can use most of the popular wallets and follow the same steps. Make sure that you have already added your custom token to your wallet. Use this guide to add a custom token to your wallet.
  • Thirdweb Account: For this tutorial, we will use Thirdweb, which is a one-click web3 development platform that supports Saga chainlets. Log in to Thirdweb using your wallet and get ready to deploy.

Adding your Chainlet to Thirdweb

The first thing we need to do is add your Chainlet on the Thirdweb platform so that we can deploy the smart contracts on it. To do this, click on the Account button which has your wallet address displayed in the top right corner.

Now click on the Network. By default, it is usually Ethereum Mainnet. Clicking on it will open the ‘Select Network’ dialog box. Click on ‘Add Custom Network’ at the bottom.

Fill in the details of your chainlet. And click on “Add Network”.

  • Network name: Name of your Chainlet
  • Network ID: This is usually auto-generated by thirdweb. Feel free to change if required
  • Chain ID: The Chainlet ID, which will be available in your Chainlet Dashboard
  • Currency Symbol: The token denom of your Chainlet
  • Network type: Select whether your Chainlet is on Mainnet or Testnet
  • Icon: You can add a graphic icon for your chainlet
  • RPC URL: The RPC endpoint of your chainlet, which will be available in your Chainlet Dashboard

Your chainlet is now configured.

Minting the NFT

To begin, we will mint an NFT that we will airdrop to the wallets. To simplify the process, we are going to use the Thirdweb ready-to-deploy smart contract templates. You can read the detailed guide to deploy your NFT on your chainlet.

Enter the name of the NFT, NFT symbol, and description of the collection. In the Network section below, make sure to select your chainlet from the list. Click Deploy. You will get multiple signature requests popping up. Sign the transactions after thoroughly verifying them. In the background, thirdweb is first going to deploy your smart contract and then add it to the dashboard. .

Fun fact: Because you are using your chainlet, the gas token used for this transaction is the token created by you. If used with a gas return account, the gas fee will be returned to the account.

Preparing your NFT

Even before you try to claim the NFT, you have to make it available. Thi is done by setting the claim conditions. For this example, we’ll set it to Public. In the Claim Conditions tab, select Public and enter the required parameters.

Next, go to the NFT tab and click on the ‘Claim’ button.

Enter your wallet address and the number of NFTs you want to create for the airdrop. Click on the ‘Claim NFT’ button

You should see the same NFT replicated the same amount of times as specified but with a unique TokenID. We will use this token id to identify them later.

Deploy an Airdrop Contract

Deploying an Airdrop Contract

Now we are going to create and deploy the smart contract to airdrop the NFT. Head over to the Airdrop Contract template in Thirdweb and hit the Deploy button.

In the Contract Parameters page enter the details of the contract.

As soon as the contract is deployed, you need to copy the contract address from the dashboard and head over to the NFT. In the NFT dashboard, under the Explorer tab, go to ‘setApprovalForAll’. Once the section opens, paste the contract address of the Airdrop contract in the Operator field. Make sure that the ‘Approved’ flag is set to ‘True’ and hit Execute.

Back in the Airdrop page, open the Explorer tab and select ‘airdropERC721’. In the section that opens up, paste the address of the NFT in the Token Address field. In the Contents field, enter the addresses to airdrop to be paired with the relevant NFT token ID in a JSON format.

The NFT will get dropped to the added wallet addresses.

Support

If you are stuck and need help with launching your chainlet, please reach out to the Saga team on Telegram, create a ticket in Discord, or drop a note to support@saga.xyz

--

--