How to create your own crypto token and deploy it on testnet blockchain | Full Guide
So with approximately 20,600 tokens floating in the whole crypto market, not all tokens are worth investing in as most of them are shitcoins with no utility, so always do your own research before investing and keep learning and keep building. This was for motivation, so in this blog you will learn exactly how to create your own crypto token and also how to deploy it on blockchains.
In essence, all the tokens, no matter fungible or non-fungible all the tokens are smart contracts at the core, so worry not if you don’t know how to code in solidity as we will be just importing codes from a library called as OpenZeppelin, and our crypto token will be created in minutes.
What is OpenZeppelin?
OpenZeppelin is a free and open-source framework for developing secure smart contracts. OpenZeppelin offers a comprehensive set of security products and audit services for developing, managing, and inspecting all aspects of software development and operations for decentralized applications.
In simple terms, it is similar to a magical wizard using which you can create secured smart contracts without actually knowing how to code.
Steps to create your crypto token
- Visit https://openzeppelin.com/ and be amazed.
- After you reach the home page, click on Products from the main menu.
- A drop down menu will appear, click on contracts.
- Contracts page will open, then click on get started.
You will not find better step by step then this. On the left hand-side of the contracts page you will find a lot of things, a lot of information you will get, read them all in your free time to learn about a lot of topics but for now we will be focusing on only on the next steps.
- Click on Wizard from the left hand-side menu.
- The wizard screen will open on the right-hand side.
- On the wizard screen, you will find a lot of options to choose from such as ERC20, ERC-721, ERC-1155, Governor, etc.
- These options are different types of smart contracts and today we are going to create an ERC-20 contract which means ERC-20 token.
What is ERC-20 & Smart contracts?
ERC-20 is the technical standard for fungible tokens made with the Ethereum blockchain. A fungible token is one that can be swapped for another token.
ERC-20 makes it possible to trade tokens that use smart contracts. In this way, tokens are a way to represent an asset, right, ownership, access, cryptocurrency, or anything else that is not unique but can be moved. Smart contracts and tokens that represent one of these things can be traded for tokens that represent the other things. Smart contracts are rules that are written into the code that make sure that different parts of a deal between two parties happen.
In most simplest terms a Smart contract is an unbreakable promise while ERC-20 is a technical standard of writing smart contracts that creates fungible tokens. Fungible tokens are those which can be traded with each other, and are not unique, for example – Bitcoin, Ether, BNB, Avax, Atom, etc.
Now you all know what exactly ERC-20 is, so let’s start the further steps and create our token.
- On the wizard screen select ERC-20, and fill the Project name ( the name you want to give to your token ) and token symbol ( just as Bitcoin has symbol BTC, you can write whatever symbol you want to give to your token ).
- The next option is Premint ( Permint is the amount of token supply that you want to create initially ), you can fill any number form example – 1000, 10000, 10000, any number of tokens that you want to create.
- Now next is the features section where you will find a lot of terms, you can read about each of them from the question mark symbol next to it.
- For our token, we will be only selecting two features that are Mintable & Burnable.
- These two features will give us the power to create more token supply after the contract deployment and we will also be able to burn the tokens.
What is token Minting & Burning?
Minting a token means creating new tokens while burning tokens means sending a certain amount of tokens to a wallet address whose private key is unknown. Burning of tokens/coins removes a certain amount of tokens supply forever.
- Next option will be access controls, select ownable.
- Do not touch the upgradability part and in the security contact section add your email address.
- Leave the license section as it is, MIT is the license that we use most commonly.
- Open a new tab in your browser.
Now, most of our work is done and our token contract is ready, now the next steps will include deploying the contract on the testnet.
Deploying the token contract on the BSC Testnet [ BNB Smart Chain Testnet ]
So follow the below mentioned steps to deploy your token contract on BSC testnet and enjoy sending your token to your friends on the testnet blockchain or if you want to deploy it on the mainnet, you can do it.
Difference between a Testnet blockchain and Mainnet blockchain
Testnet blockchains are fake blockchains ( prototype blockchains ) for testing the projects while mainnet are the fully developed blockchains for sending and receiving value to different users.
When we deploy something on the Testnet blockchain, we use fake cryptos called testnet cryptos for paying the gas fees while on the mainnet everything is done using the real cryptos.
Now follow the below mentioned steps and setup everything for deploying the contract:
- Set up ( create ) your metamask account, if you don’t have one.
- Go to https://rpc.info and scroll a bit and you will find the Binance Smart Chain section ( It is actually rebranded to BNB CHAIN but these folks don’t know this ) and click on add to metamask on the Binance smart chain testnet ( It is the last one in the section ).
- Check again, add the testnet blockchain only.
- Now we have our testnet is setted up, let’s look out for our testnet cryptos for paying gas fees.
- Head over to https://testnet.binance.org/faucet-smart and prove to them that you are a human.
- Copy your testnet wallet address from the Metamask and paste it there in the provided space and click on, “ Give me BNB”.
- After 4 to 5 seconds you will receive your testnet BNB in your Metamask wallet.
Final steps towards deploying the contract
- Go back on the Openzeppelin Wizard page and click on the “ Open in Remix button “
- Remix is the development environment where our code is written.
- Now on the left hand side of the remix you will find a lot of icons, click on the solidity icon symbol, it is like a sharp S.
- After you click on the solidity icon, click on the compile contract and your contract will be compiled.
- Now click on the symbol that is like the Ethereum icon.
- In this section, on the top you will find environments, click on that, a drop down menu will open up.
- Select Injected-Web3 provider from that.
- Make sure that your Metamasak is on the Testnet blockchain.
- After that, if a Metamask popup comes, click on confirm or sign.
- Now click on deploy, a Metamask popup will come, click on confirm and booom your token contract is deployed and your token is ready.
Happy! Now if you have followed all the steps, you have now successfully created your token and you will able to track it on testnet blockchain explorer that is https://testnet.bscscan.com/
Follow the tutorial video below if you are still facing any problem.