This section is designed to get the casual smart contract developer up and running deploying HRC20 tokens (Harmony's ERC20 equivalent) on a harmony network. This can be done in under one Minute.
This github repository contains the code and files used in this demo. You can also find many more examples that uses the HRC20 tokens in this github repository.
Here is a short video running through the deployment.
npm install -g truffle@5.0.38git clone https://github.com/harmony-one/H20.gitcd H20cp .envSample .envnpm installtruffle compiletruffle migrate --network testnet --resettruffle networks
truffle console --network testnettruffle(testnet)> HarmonyERC20.deployed().then(function(instance){myHRC20=instance})undefinedtruffle(testnet)> myHRC20.symbol()'H20'truffle(testnet)> myHRC20.name()'HarmonyERC20'truffle(testnet)> myHRC20.decimals()BN { negative: 0, words: [ 18, <1 empty item> ], length: 1, red: null }truffle(testnet)> myHRC20.totalSupply()BN {negative: 0,words: [ 16777216, 62077800, 20718012, 3, <1 empty item> ],length: 4,red: null}