How to Let Users Mint NFTs from your Saga Chainlet

Kyle
Sagaxyz
Published in
5 min readJun 26, 2024

NFTs function as a fundamental block in the gaming world, creating endless possibilities of gameplay and monetization. They can also be used as an entry point to web3 games as early access passes or even NFT memberships. In this tutorial, we will show you how your community can mint NFTs from your Saga Chainlet.

In this tutorial, we will:

  1. Add a Saga Chainlet to the Thirdweb platform
  2. Deploy NFT minting contract
  3. Add the NFT
  4. Set claim conditions

Requirements

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

  • Saga Chainlet: We will deploy the NFT 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.

Deploying NFT Minting Contract

Now we need to create and deploy an NFT Edition drop smart contract. To simplify the process, we are going to use the Thirdweb ready-to-deploy smart contract templates. Head over to NFT Edition Drop on the thirdweb platform.

Click on Deploy Now and enter the parameters to configure your NFT token.

Enter the name of the collection, 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.

Adding the NFT

Go to the NFT tab and click on the ‘Single upload’ button.

In the popup, enter the NFT metadata and upload the media file. You can also specify the NFT properties like the attributes of the NFT here.

Click on Mint NFT. Once you sign the transaction, you should see your NFT in the dashboard.

Setting Claim Conditions

Now that you have minted your own NFT, we need to enable the community to mint it. To do that, open the ‘Claim Conditions’ tab in the NFT dashboard and click on ‘Add Phase’.

Here you can decide who can claim the NFT. The options available are:

  • Public: Anyone from the community with access to the link can claim
  • Public (With Allowlist): Anyone from the community can claim, but addresses on the allowlist have special benefits (claim opens earlier, can claim multiple etc)
  • Allowlist Only: Only community members whose addresses are on the allowlist can claim
  • Only Owner: Only the owner can claim the NFT

You can chose any of the above options. For this example, we are keeping it open to the Public.

You can set when the claims open and how many NFTs are available to claim. You can also set a price per NFT which can be paid using the native token or any custom ERC20 token.

Now your community can go and claim the NFT. We have created an UI for the users to connect the wallet and mint their NFT. It would look like this.

Once minted, the NFT will be available in the user’s wallet.

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

--

--