Launching your own Game on Saga

Shayan Ghose
Sagaxyz
Published in
6 min readAug 11, 2023

Part 3: Launch your own NFTs in minutes

Introduction

This blog post is the third of a series designed to walk you through the steps of launching your own chain that can host its own game, whether the game is fully on-chain, meant to store gamestate in real time or only has in-game assets. In crypto today, most games choose to launch on monolithic chains that they do not control, where developers are limited by the design choices that are specific to that chain. But on Saga, where developers can launch their own chain, there is a far greater degree of flexibility, customizability and throughput that a developer can have access to. In this series, we’ll show you some of the basics of deploying your own chain on Saga while also demonstrating the unique things that one can do with Saga that isn’t possible in other ecosystems. Specifically, we’ll show you how you can:

  • Blog Post #1: Launch your own EVM chain in minutes and connect it to its own block explorer, web-sockets and RPC endpoints.
  • Blog Post #2: Connect and deploy pre-audited smart contracts directly onto your own chain such as an ERC-20 token contract.
  • This Post #3: Deploy pre-compiled NFT minting contracts onto your own chain.
  • Blog Post #4: Deploy an NFT exchange and build a tokenized in-game economy.
  • Blog Post #5: Demonstrate the power of your own dedicated EVM chain, such as streaming live game events directly to your own chain.

In the first blog post, we discussed how to launch your own EVM-compatible chain on Saga in less than 10 minutes using the Saga CLI. In the second blog post, we discussed how to add in a compatible ERC-20 token to our chain.

In this post, we’ll discuss how to easily add NFTs to our chain that can represent any type of unique digital asset. A unique digital asset can include anything from a digital profile picture to an in-game asset, music or any type of arbitrary data; the possibilities are endless.

Let’s dive in.

Step 1: Go to thirdweb.com and sign in with your Metamask account

thirdweb — a Saga Innovator — provides best-in-class developer tools to build, manage and analyze web3 apps. Their tooling is open-source, decentralized and permissionless. They have SDKs for both smart contract development and front-end management across a variety of programming languages, such as TypeScript, Javascript, Python, React and Go. For the purpose of this tutorial we will be utilizing some of their pre-audited smart contracts to mint an NFT collection.

Go to https://thirdweb.com/explore, scroll down and click on ‘NFT Collection’. Make sure to connect your ‘Metamask’ like we did in the previous tutorial.

Step 2: Deploy NFT minting contract to your Saga Chainlet

An NFT collection contract is typically suitable for when a developer wants to have a collection of unique NFTs but not ‘drop’ or ‘release’ them for your community to claim. An NFT collection can be used to create digital assets of photography, utilized to provide special utility to a game or application and even be created by community members.

In this tutorial, we will be deploying NFTs to our chain, so go ahead and click on “Deploy Now” at the top left. The following side-bar should pop up. Please fill in the details as you see fit. This author is deciding to create Star Wars lightsaber NFTs that could potentially be used for battle in npc land. Go ahead and fill in your own details for the type of NFT you’d like to mint.

Like we did in the last tutorial, select your chain from the drop down menu at the bottom, and then go ahead and click deploy now. You will be asked to sign a few transactions from your metamask to officially deploy the NFT minting contract to your chain.

Step 3: Mint your first NFT from the NFT contract

From here, we are now ready to mint our first NFT. Go back to the NFT contract page, and click on the ‘NFT’s tab’ below.

Click on ‘Mint’ on the next page to fill in the information related to the NFT you’d like to mint. For the lightsaber NFT, this author is adding a picture of a ‘tonfa lightsaber’. I have also added a few attributes such as handle type, length and strength of the saber. Once you have filled in all the relevant details, go ahead and click ‘Mint NFT’. You will be asked to sign a few more transactions from Metamask.

Step 4: Confirm the existence of your NFT on Metamask.

We can confirm the existence of the NFTs we have minted from Metamask. Open your Metamask, and click on the NFTs tab. If you don’t see your NFT there, click on “Import NFT” at the bottom of your Metamask screen and the following should pop up.

For token address, you will be putting in the NFT minting contract address. That can be copy and pasted from the thirdweb webpage. For this author, that address begins with 0xf3ad, and since this is the first NFT minted, the token ID will be ‘0’

Once you do that, we should be able to see the NFT in our metamask wallet. Feel free to also confirm the set of transactions from your block explorer as well!

This author has created 5 lightsabers that are now minted as NFTs. They can be seen below from Metamask. Please go ahead and mint a few more NFTs on your chain

Conclusion and Next Steps

So let’s summarize what we’ve done over the course of the tutorial. We have connected our Saga chainlet to thirdweb’s infrastructure, created an NFT minting contract and used that minting contract to mint custom NFTs to our very own chain. From there, we confirmed the existence of these NFTs from Metamask.

In the next tutorial, we’ll discuss how to create an on-chain economy for the NFTs that we just minted! This will involve deploying more robust smart contracts onto our Chainlet and get started with building on-chain elements of a game!

To learn more about Saga’s approach to blockchain gaming, click here. Follow us on Twitter or join our Discord.

--

--