Deploy HRC20
This section describes how to deploy a HRC20 smart contract on Harmony in 1-minute.

Overview

This section is designed to get the casual smart contract developer deploying HRC20 tokens (Harmony's ERC20 equivalent) on Harmony Network. This can be done in under one Minute.
This github repository contains the code and files used on this demo. You can also find many more examples that use HRC20 tokens on this github repository.

One Minute Deployment

Here is a short video running through the deployment:

One Minute Instructions

1
npm install -g [email protected]
2
git clone https://github.com/harmony-one/H20.git
3
cd H20
4
cp .envSample .env
5
npm install
6
truffle compile
7
truffle migrate --network testnet --reset
8
truffle networks
Copied!

Interacting with Contracts

1
truffle console --network testnet
2
truffle(testnet)> HarmonyERC20.deployed().then(function(instance){myHRC20=instance})
3
undefined
4
truffle(testnet)> myHRC20.symbol()
5
'H20'
6
truffle(testnet)> myHRC20.name()
7
'HarmonyERC20'
8
truffle(testnet)> myHRC20.decimals()
9
BN { negative: 0, words: [ 18, <1 empty item> ], length: 1, red: null }
10
truffle(testnet)> myHRC20.totalSupply()
11
BN {
12
negative: 0,
13
words: [ 16777216, 62077800, 20718012, 3, <1 empty item> ],
14
length: 4,
15
red: null
16
}
Copied!
Last modified 11mo ago