Learning CLI tool to create, deploy and interact with ERC20 tokens using Go.
- Install Go. The project currently uses version 1.18.
- Install npm.
- Install solc compiler and abigen.
- Run
make
in order to compile the contract and install the CLI tool. - Run
tokencli --help
and the tool help message will appear.
The main contract is already defined here and just implements the ERC20 interface.
The contract implementation overrides the decimal()
method of the ERC20 interface to allow a 6 decimal representation. This because the generated bindings only accept a big.Int which can represent values up to 64-bit signed integrers (9*10^18 aprox.). This would mean that only a totalSupply of 9 full tokens would be possible with 18 decimals. Since this is just a learning tool, the default decimals have been lowered to 6, allowing more possibilities.
The MIT License (MIT) 2022 - Marc Puig. Please have a look at the LICENSE for more details.