How to Create Your First Token on Gno.land Testnet in 5 Minutes

Onbloc
Onbloc
Published in
6 min readDec 8, 2023
Image Source: Binance Academy

Intro

Gno Playground is now available in beta, which means developers can access a lightweight Gnolang development environment on their browser, akin to Go’s playground.

Gno Playground allows you to write and deploy smart contracts in Gnolang in seconds without locally setting up your environment.

We tested out the Playground ourselves and were able to mint a token on the Gno.land testnet blockchain in just a few minutes from scratch. To help you get a taste of this magical experience, we’ve prepared a simple guide.

This guide is designed for anyone — including non-coders — to easily understand and follow along. Stick to the step-by-step instructions, and you’ll be surprised to discover how simple and intuitive Gnolang truly is.

Let’s get started!

Step 1. Download Adena

You’ll need an extension wallet to deploy your contract. Download the Adena Wallet and set up your Gno.land account. Creating an account on Adena is simple, straightforward, and takes seconds! If you get lost, refer to the video guide below.

Step 2. Visit Gno Playground

Visit Gno Playground at: https://play.gno.land/

Gno Playground is a Swiss Army Knife for developers that comes with syntax highlighting for Gnolang with support for testing, sharing, and even deploying your contract with just a few clicks.

Source: Gno Playground

Take a few moments to look around before proceeding to the next step.

Step 3. Customize Your Testnet Token

Now, let’s write the contract for your token!

A few quick facts about Gnolang and Gno.land…

Gnolang is an interpreted and deterministic version of the popular Golang that powers the Gno.land blockchain, meaning all contracts are viewable in raw code directly from the chain. This novel trait makes Gno.land the most transparent blockchain in existence.

As a smart contract platform, Gno.land comes with its own fungible token standard called GRC-20, which resembles the ERC-20 standard on Ethereum.

We will reference the source code of the FOO token (a sample smart contract that demonstrates the GRC-20 standard) and customize it.

To help you get started, we’ve prepared the code on Gno Playground using its amazing Share function. Click on the link below to start editing the code right away.

1. Set Your Package Name

The package name is set to foo by default. To change it, press Control + F to open the search tool. Enter foo in the upper field, your package name (apple in the example below) in the lower field, then click on Replace All.

Package names are “contract addresses” in Gno.land. Unlike obscure values such as “0xef1…952kc”, smart contracts in Gno.land are identified with human-readable paths like “gno.land/demo/foo” that resemble domain names for websites. Each path is unique, which means that you must choose a package name that doesn’t yet exist. Choosing a duplicate name will result in an error during deployment.

2. Set Yourself as the Admin

Change the address in Line 14 to your own address by copying and pasting from your Adena Wallet. This will allow you to mint or burn tokens.

3. Set the Token Info

Change the values inside the parentheses in Line 18. The values are name, symbol, and address in order. We recommend setting the decimal to 6.

4. Set the Initial Supply

Change the number in Line 19 from 1000000000 to your desired supply. This will mint this number of tokens to the admin address.

Once you’re done, press Control + S to save your changes.

That’s it! How simple was that?

Step 4. Deploy Your Testnet Token

Click on the Deploy button in the header to open the deployment tool. In the tool, click on Connect and approve the connection request in your Adena Wallet.

You must set the path for your token. You’ll first see the option to choose between p and r. p stands for pure packages, which are stateless contracts meant to serve as libraries. r stands for realms, which are stateful contracts that power dApps. Choose the r option. The namespace is a way to group packages. For now, set it to demo. Lastly, enter the package name you’ve set in the previous step.

Your path should look like this: gno.land/r/demo/yourpackagename

Now, click on Deploy and approve the contract in Adena.

If you need transaction fees, visit the #adena channel in the Gno.land Discord Server and ask for testnet GNOTs.

Next, confirm that your transaction was successful in the History menu in Adena.

You can now also add your token to your wallet by clicking on the Manage Tokens button in the Wallet menu.

Adding a custom token in Adena

Furthermore, the Tokens Page of Gnoscan Explorer will now display your token. Without manually verifying your address like in other blockchains, the full source code of your token is available upon deployment. This is a testament to the unparalleled transparency that Gno.land offers to smart contracts.

Congratulations, you’ve successfully minted your first token in the testnet!

Step 5. Share With Your Friends!

The purpose of this guide was to demonstrate the transparency, simplicity, and intuitiveness of Gnolang in an enjoyable way.

Gno.land’s vision is to build a blockchain that offers a friendly development experience and a sustainable rewards system to provide an environment to onboard developers to build killer apps — the essentials towards mass adoption of Web3.

Gno.land is still in its nascent stage and looking for more Contributors who can help achieve this mission.

As a developer, dive into the rabbit hole by visiting the official gno repository on GitHub. As a non-developer, you can still contribute by spreading awareness by sharing this guide!

If you enjoyed this guide, be sure to follow us on our social channels below, where we regularly upload new content on Gno.land. Thank you for reading!

--

--

Onbloc
Onbloc
Editor for

A blockchain software development firm based in Seoul