Issue ERC20 Token
Overview
ERC-20 is the technical standard for fungible tokens created on the EVM-compatible blockchain. An ERC20 token contract keeps track of fungible tokens: any token is exactly equal to any other token; no tokens have special rights or behavior associated with them. This makes ERC20 tokens useful for things like a medium of exchange currency, voting rights, staking, and more.
As we know, both OpenZeppelin and ConsenSys maintain the standard library of ERC contract classes. Simply put, ERC20 is nothing more than a class with methods and members that run the logic of what we usually call cryptocurrency. However, it has a broader meaning because it also has applications in other use cases.
Having explained why we imported the OpenZeppelin library and what ERC20 means, let's move on to learning how to create and deploy an ERC20 token with the OpenZepplin library.
Note
Additionally, OpenZeppelin offers some ERC20 extension contracts. Please review the details if you are interested.
Pre-requisites
Install Metamask
Configure DoCoin Community Chain Testnet on Metamask
Get Testnet token
Compile and Deploy ERC20 Token
Open Remix IDE: https://remix.ethereum.org/
Create the contract
Create a new
Token.sol
contract and copy the below contract code toToken.sol
Compile the contract
switch to the compile page
Select proper compiler
Select
KIP20Token(Token.sol)
contractAnd then click
Compile Token.sol
Compile the contract
Click the button to switch to compile button
Select
Injected Provider-MetaMask
Select
KIP20Token-Token.sol
Fill in many tokens you want to mint and click
Deploy
button
Click
Confirm
button to sign and broadcast the transaction to DCC Testnet
Add custom token to MetaMask
Copy the deployed contract address
Click
Import Tokens
Paste the contract address to the
Token contract address
And the
Token symbol
andToken decimal
will auto tilled by MetaMaskFinally, Click the
Add custom token
Click the
Import tokens
button
When you reopen the MetaMask next time, you will see the token and amount
Conclusion
This tutorial guides you through the basics of creating and deploying an ERC20 token contract based on the OpenZepplin library using the Remix IDE on the DCC Testnet. It should be noted that the exact same instructions and sequence will also work on DCC Mainnet.
Last updated