ERC-20
Last updated
Last updated
This tutorial helps you to create an example ERC-20 compatible token that conforms to the , especially .
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 .
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 and following Solidity files are used to implement MyERC20.sol
.
The rest of this tutorial is organized as follows.
1.1 Overall structure of MyERC20
code with whole MyERC20
code
1.2 Take a look at important functions
2.1 Deploying smart contract using Klaytn IDE
2.2 Deploying smart contract using truffle