TLDR:
Soulbound tokens, originally proposed by Vitalik Buterin, at their core are simply non-transferable NFTs.
In this tutorial, you will:
To get from zero to a deployed soulbound token contract on the Gnosis Chain Chiado testnet, do the following:
With Chainstack, create a .
With Chainstack, join Gnosis Chain Chiado testnet.
With Chainstack, access your Gnosis Chain node credentials.
Set up your MetaMask to work through a Chainstack node.
With Remix IDE, create and compile the soulbound contract.
With Remix IDE, deploy the contract on the Gnosis Chain Chiado testnet.
Issue a soulbound token and burn it.
See Create a project.
See View node access and credentials.
See Gnosis Chain tooling: MetaMask.
Open Remix IDE.
On the home page, click Environments > Solidity.
On the left pane, click File explorers > contracts > New File.
In the modal, give any name to your contract. For example, soulbound.sol
.
Put in the contract code:
This is your soulbound token contract:
Compile the contract. On the left pane, click Solidity compiler > Compile.
Fund the account that you will use to deploy the contract with xDAI. Use the xDAI testnet faucet.
On the left pane, click Deploy and switch to Injected Provider - MetaMask.
On the left pane:
Click Deploy & run transactions.
In contract, select contracts/soulbound.sol.
Click Deploy.
This will engage your MetaMask to deploy the contract to the Gnosis Chain Chiado testnet through your currently selected MetaMask account. Click Confirm in the MetaMask modal.
Once your contract is deployed, you can view it online at Blockscout Gnosis Chain Chiado testnet explorer.
You are now going to verify the contract in the Blockscout explorer to be able to use the explorer as a web app and easily interact with the contract online.
Since your soulbound contract uses imported OpenZeppelin libraries, you must put all the imports into one .sol
file to make Blockscout be able to verify it.
The flattened contract is now in your clipboard.
Go to Blockscout explorer.
Find your deployed contract. The address of your contract on the left pane of Remix IDE under Deployed Contracts.
On the contract page on Blockscout, click Code > Verify & Publish.
Select Via flattened source code.
In Contract Name, provide the name of your contract. In our example, the name is SoulBoundToken
.
In Compiler, select the same compiler version that was used in Remix IDE.
In Optimization, select No.
In Enter the Solidity Contract Code, paste the flattened contract code.
Click Verify & publish.
Blockscout will take a few seconds to compile your contract, verify, and publish it.
Now that your soulbound contract is verified, you can check Blockscout to interact with it.
On Blockscout, on your contract, click Write Contract.
In your MetaMask, make sure you have the same address selected as the one that deployed the contract.
Click Connect wallet. This will connect your MetaMask instance with the contract owner as the active address.
In safeMint, provide an address that you own and to which you will issue a soulbound token.
Click Write.
This will issue a soulbound token to the provided address.
Now that your other account has a soulbound token, you can burn it.
In your MetaMask instance, switch to the account that has a soulbound token tied to it.
0
.This will send the soulbound token from the current owner to the address 0x0000000000000000000000000000000000000000
.
This tutorial guided you through the basics of creating and deploying a simple soulbound contract on the Gnosis Chain Chiado testnet through your Chainstack-deployed node.
You have also interacted with the contract, issued, and burned the token using Blockscout as a web app and MetaMask as your interaction tool that works through your Chainstack-deployed Gnosis Chain node.
TLDR:
Soulbound tokens, originally proposed by Vitalik Buterin, at their core are simply non-transferable NFTs.
In this tutorial, you will:
To get from zero to a deployed soulbound token contract on the Gnosis Chain Chiado testnet, do the following:
With Chainstack, create a .
With Chainstack, join Gnosis Chain Chiado testnet.
With Chainstack, access your Gnosis Chain node credentials.
Set up your MetaMask to work through a Chainstack node.
With Remix IDE, create and compile the soulbound contract.
With Remix IDE, deploy the contract on the Gnosis Chain Chiado testnet.
Issue a soulbound token and burn it.
See Create a project.
See View node access and credentials.
See Gnosis Chain tooling: MetaMask.
Open Remix IDE.
On the home page, click Environments > Solidity.
On the left pane, click File explorers > contracts > New File.
In the modal, give any name to your contract. For example, soulbound.sol
.
Put in the contract code:
This is your soulbound token contract:
Compile the contract. On the left pane, click Solidity compiler > Compile.
Fund the account that you will use to deploy the contract with xDAI. Use the xDAI testnet faucet.
On the left pane, click Deploy and switch to Injected Provider - MetaMask.
On the left pane:
Click Deploy & run transactions.
In contract, select contracts/soulbound.sol.
Click Deploy.
This will engage your MetaMask to deploy the contract to the Gnosis Chain Chiado testnet through your currently selected MetaMask account. Click Confirm in the MetaMask modal.
Once your contract is deployed, you can view it online at Blockscout Gnosis Chain Chiado testnet explorer.
You are now going to verify the contract in the Blockscout explorer to be able to use the explorer as a web app and easily interact with the contract online.
Since your soulbound contract uses imported OpenZeppelin libraries, you must put all the imports into one .sol
file to make Blockscout be able to verify it.
The flattened contract is now in your clipboard.
Go to Blockscout explorer.
Find your deployed contract. The address of your contract on the left pane of Remix IDE under Deployed Contracts.
On the contract page on Blockscout, click Code > Verify & Publish.
Select Via flattened source code.
In Contract Name, provide the name of your contract. In our example, the name is SoulBoundToken
.
In Compiler, select the same compiler version that was used in Remix IDE.
In Optimization, select No.
In Enter the Solidity Contract Code, paste the flattened contract code.
Click Verify & publish.
Blockscout will take a few seconds to compile your contract, verify, and publish it.
Now that your soulbound contract is verified, you can check Blockscout to interact with it.
On Blockscout, on your contract, click Write Contract.
In your MetaMask, make sure you have the same address selected as the one that deployed the contract.
Click Connect wallet. This will connect your MetaMask instance with the contract owner as the active address.
In safeMint, provide an address that you own and to which you will issue a soulbound token.
Click Write.
This will issue a soulbound token to the provided address.
Now that your other account has a soulbound token, you can burn it.
In your MetaMask instance, switch to the account that has a soulbound token tied to it.
0
.This will send the soulbound token from the current owner to the address 0x0000000000000000000000000000000000000000
.
This tutorial guided you through the basics of creating and deploying a simple soulbound contract on the Gnosis Chain Chiado testnet through your Chainstack-deployed node.
You have also interacted with the contract, issued, and burned the token using Blockscout as a web app and MetaMask as your interaction tool that works through your Chainstack-deployed Gnosis Chain node.