KCC Documents
  • Quickstart
  • Overview
    • Introduction
    • Features
    • Our Goal
    • Consensus Engine
    • Marketing Guide
      • Requirements
      • KCC Official Website Resource
      • KCC Social Media Promotion
      • PR & Third-Party Marketing Support
  • Developers
    • Network Endpoints
    • Deploy Smart Contract
      • Using Hardhat
      • Using Remix
    • Verify Smart Contract
      • Using Hardhat
      • Using Foundry
      • Using Remix
    • Issue ERC20 Token
    • Deploy NFTs
      • Create A Foundry Project
      • Create Your ERC721 Contract
      • Add Metadata
    • Run a Node
      • Hardware & System Requirements
      • Install KCC
      • Run A Full Node
      • Run A Validator Node
        • Block Rewards
        • Apply For Running A Validator
        • Manager Account And Validator Account
        • Run A Validator
      • Troubleshooting
    • Explorer
    • Oracles
      • KCC Oracle
    • Bridge
    • Dev Toolkit
    • Data
      • Indexing and Querying
        • The Graph
        • Using KCC's hosted subgraph
    • Gas Revenue Program
      • Rules for Calculation of Gas Revenue
      • How to Join the KCC Gas Revenue Program
  • Individuals
    • Wallet
      • Supported Wallet
      • Tutorial on how to set up wallet
      • Mutisig Wallet
        • Create New Safe
        • Send KCS From Your Safe
        • Use A DApp With Your Safe
    • Network Configuration
      • Configure Value
      • Tutorial on how to config KCC network in Metamask
      • Tutorial on how to config KCC network in Chainlist
    • Bridge Assets
      • Bridge assets from others chains
      • KCC Bridge
      • Bridge assets form Exchange
    • Find a dApp
      • Add Your dAPP
    • KCS Token
      • Get KCS
      • Stake KCS
        • How to participate in KCS Staking
        • How to redeem staked KCS
        • How to check or claim staking rewards
  • FAQs
    • FAQs
      • General FAQs
      • KCS and Staking FAQs
      • Validator FAQs
  • Future Developments
    • Milestone
  • CONTACT US
    • Contact Us
  • Disclosure
    • Disclaimers
    • Risk Statement
    • Media Kit
Powered by GitBook
On this page
  • Overview
  • Pre-requisites
  • Compile and Deploy ERC20 Token
  • Open Remix IDE: https://remix.ethereum.org/
  • Create the contract
  • Compile the contract
  • Compile the contract
  • Add custom token to MetaMask
  • Conclusion​
  1. Developers

Issue ERC20 Token

PreviousUsing RemixNextDeploy NFTs

Last updated 2 years ago

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

Pre-requisites

  • Install Metamask

  • Configure KuCoin Community Chain Testnet on Metamask

  • Get Testnet token

Compile and Deploy ERC20 Token

Create the contract

  • Create a new Token.sol contract and copy the below contract code to Token.sol

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract KIP20Token is ERC20 {
    constructor(uint256 totalSupply) ERC20("DemoToken", "DET") {
        // create totalSupply of tokens for the deployer
        _mint(msg.sender, totalSupply);
    }
}

Compile the contract

  • switch to the compile page

  • Select proper compiler

  • Select KIP20Token(Token.sol) contract

  • And 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 KCC 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 and Token decimal will auto tilled by MetaMask

  • Finally, Click the Add custom token

  • Click the Import tokens button

  • When you reopen the MetaMask next time, you will see the token and amount

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 KCC Testnet. It should be noted that the exact same instructions and sequence will also work on KCC Mainnet.

Additionally, OpenZeppelin offers some . Please review the details if you are interested.

Open Remix IDE:

Conclusion

ERC20 extension contracts
https://remix.ethereum.org/
​