ERC-20
Introduction
This tutorial helps you to create an example ERC-20 compatible token that conforms to the Klaytn Token Standards, especially Fungible Token Standard (ERC-20).
ERC-20 Token Standard defines two events and 9 methods (including 3 optional methods) as below. ERC-20-compatible tokens are token contracts that implements the following interface.
Based on above interface, developers may customize tokens by adding new features and logics, and deploy on Klaytn network. For more information, refer to official ERC-20 documentation.
In this tutorial, you are going to implement MyERC20.sol
, an ERC-20 compatible token. This token will issue a predefined amount of tokens and sends all of the tokens to the contract owner on its deploy.
MyERC20.sol
is based on OpenZeppelin's ERC20 implementation. A major part of the code in this tutorial is forked from OpenZeppelin 2.3 and following Solidity files are used to implement MyERC20.sol
.
The rest of this tutorial is organized as follows.
1. Writing ERC-20 smart contract
1.1 Overall structure of
MyERC20
code with wholeMyERC20
code1.2 Take a look at important functions
2.1 Deploying smart contract using Klaytn IDE
2.2 Deploying smart contract using truffle
Last updated