Table of Contents
ERC 20 tokens are issued on the Ethereum network. They have emerged as the technical standard on the Ethereum blockchain for token implementation and provides a list of rules that all Ethereum-based tokens must follow. Side note : Ethereum is a layer 1 blockchain that carries several independent and dependent L1 and L2 blockchains as a result of its highly automated/virtualized EVM.
‘ERC’ stands for ‘Ethereum Request for Comment’. ERC-20 specifically has six different coding functions. In terms of implementation of the coding for ERC-20 tokens, the six basic coding functions are as follows :
In this step-by-step tutorial, you will learn how to create and deploy an ERC-20 token on Shardeum Sphinx Dapp testnet (betanet). We will use Metamask and Remix IDE for this tutorial.
MetaMask allows users to store and manage account keys, broadcast transactions, send and receive Ethereum-based cryptocurrencies and tokens, and securely connect to decentralized applications through a compatible web browser or the mobile app’s built-in browser. Click here to install the MetaMask extension on your browser.
And follow this instruction to add Shardeum to MetaMask wallet and claim test 100 $SHM tokens from Sphinx Dapp faucet.
We are using Remix IDE for writing the smart contract as mentioned above. In Remix, create a new contract file. As a reference, I named mine as ‘ShardeumERC20Token.sol’ – you can name it as you want. And, in the contract, write the following code:
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract ShardeumERC20Token is ERC20 {
constructor(string memory _name, string memory _symbol) ERC20(_name, _symbol){
_mint(msg.sender, 10000 * 10 ** 18);
}
}
Let me explain the code in brief for your reference :
10 * 10 ** 18
– (which is actually 10 ^ 18) specifies that you want 10000 full tokens to be minted to your address.Compile your contract by going over to the ‘Compiler’ tab in Remix and selecting ‘ShardeumERC20Token.sol’, and then hit ‘Compile’.
Let’s deploy a fixed supply of 10000 Tokens (You can change it to other supply at code level).
Go to the ‘Deployer’ tab in Remix.
Select the ‘Injected Web3’ environment (make sure you select Shardeum Sphinx Dapp 1.X Network), and connect your MetaMask wallet.
Now, select the ‘ShardeumERC20Token.sol’ contract, and enter values for the constructor arguments ‘_Name’ and ‘_Symbol’ as shown in the image below.
Proceed to click ‘Transact’ and approve the transaction in ‘Metamask’ to deploy your contract!
You have now successfully deployed ERC-20 Token on Shardeum Sphinx Dapp!!
After deploying, click the ‘Copy Address’ button to copy the contract address.
You can now go to Shardeum Explorer and search for your contract address and you should be able to see it there!
Take a screenshot of it and feel free to promote your newly created token on social media channels. Note these tokens have no real world value. Ethereum based developers can use them for paying transaction/gas fees to deploy and develop their projects/dApps on Shardeum testnet and become a leader of the ecosystem by the time Shardeum launches mainnet in Q4 of 2022. The other great thing about Shardeum is you don’t have to worry about rising gas fees again because the estimated gas/transaction fee on the network will be $0.01!
Now, copy your contract address
Open Metamask and click ‘Import Tokens’ in the Assets tab
You can now enter your ‘Token Contract Address’, and it should detect the name and number of decimals automatically.
Then click ‘Add’, and you will see your balance in MetaMask!
Congratulations! You’ve successfully deployed and minted your own ERC-20 token on Shardeum testnet!
And here is the GitHub link of the code used to create my own cryptocurrency on Shardeum.
Why to Invest in DeFi Coins and Token | Mobile App Technology Stack | How to Buy Real Estate in the Metaverse | Blockchain Scalability Solutions | Public Blockchain Examples | Top Altcoins | What is Proof of Work in Blockchain | Crypto Cloud Mining | Best Place to Mint NFT | What is Stake in Crypto | What is a Governance Token | Benefits of Blockchain | What is Blockchain Security | Can Blockchain be Hacked | What is Crypto Metaverse | How to Keep Crypto Safe | Bitcoin VS Ethereum | What is a Crypto Whale | What is Staking in Crypto | Ethereum that are Compatible with the EVM
Opinions expressed in this publication are those of the author(s). They do not necessarily purport to reflect the opinions or views of Shardeum Foundation.
About the Author : Vaijanath is into Crypto & Blockchain space since 2017. He is a BUIDLer, Trader, Investor, Cryptopreneur and man of many trades. You can follow him on Twitter