# 1.2 - HRC-20 Harmony Token

### Harmony Coins

[<mark style="color:blue;">Harmony's Block Explorer</mark> ](https://explorer.harmony.one/hrc20) -  Every contract that has ever transacted on the Harmony network can be found on this Block Explorer. If you need help Navigating the Explorer, we made a video explaining how to navigate it HERE --> [Explore](https://www.youtube.com/watch?v=wpLEemEncuo)

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FNIxOU2n2jEMIFePUI6ss%2FScreen%20Shot%202022-01-03%20at%206.18.34%20PM.png?alt=media\&token=3f700fe9-5150-484f-859d-fa79a76cc122) [**Openswap**](https://app.openswap.one/)

The Harmony blockchain offers its own native tokens that have their own shared economy's. Token created on the harmony blockchain have the ability to swap cheaply and fluidly with Harmony ONE tokens.&#x20;

### Transaction Cost

Jan 3, 2022 that harmony network has plans to make the cost of a single transaction 30 gwei. ![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FX4pK7U70FOivLRjDDhAs%2FScreen%20Shot%202022-01-03%20at%206.25.05%20PM.png?alt=media\&token=9a287506-f2aa-44c2-9f36-d651a912a3c5) that's cheap...

### Speed

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FkeInOfNUQdmUrxxx5UOA%2FScreen%20Shot%202022-01-03%20at%206.26.19%20PM.png?alt=media\&token=427f8407-497e-45ae-bc8f-b149a8cfc062) There average is > 2 Million & < 4 Million

with this many transactions, they clock in a 2.31 seconds at high volumes. Low volume metrics have show 1.97 seconds. Harmony has plans for 2022 according to their roadmap, to reach a 1 second finality.&#x20;

To achieve such speeds, the Harmony foundation intends to implement what's known as "*re-sharding*" for their blockchain. There are still very little details on this; design updates will be found here --> [<mark style="color:blue;">**Harmony Roadmap**</mark>](https://open.harmony.one/strategy-roadmap)

### **Effective Proof of Stake**

Harmony offers delegators the option to stake to a validator on their staking dashboard --> [<mark style="color:blue;">**Harmony Staking**</mark> ](https://staking.harmony.one/validators/mainnet)

The "effective" part is the equivalent to say "equal". If a Validator owns a large stake and occupies many *slots* with what are known as a *BLS Keys,* there is an algorithm in the Harmony Protocol that balances out the token reward distribution between all the validators. This gives many Delegators (*Coin* *investors*) the freedom to choose to stake to any number of Validators and expect the same return in ONE tokens.&#x20;

### Bridging&#x20;

The Harmony foundation has worked hard to release Ethereum light clients to the Ethereum blockchain to natively transfer any EVM compatible token to the Harmony network. ONE tokens are the bridged asset for many Blockchains, including Ethereum, Cosmos, Polygon, Bitcoin, Avalanche, Terra, the Binance Smart Chain and Chainlink <br>

![Visit the --> Horizon Bridge](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FTMQTAVDvjQFpQiRDdKDp%2FScreen%20Shot%202022-01-03%20at%206.39.42%20PM.png?alt=media\&token=fb2f1478-dae7-42b8-9eb7-be36f498aa5a)

### Governance

HRC-20 come equipped DAO (*Decentralized Autonomous Organization*) governing options. Token holders can influence the foundations most critical decisions as a business and as an ecosystem. Some believe this to be a risk for any foundation to take, but the harmony foundation intends to be community led by year 2025.&#x20;

* Vote for Harmony (100 ONE == 1 vote) -->[ <mark style="color:yellow;">**Snapshot**</mark> ](https://gov.harmony.one/#/staking-mainnet)

## Create a HRC-20

Harmony has their own token standards that can be followed on their documentation site. HRC-20 tokens will work on any Harmony.one Decentralized application. The EVM's compiler is built into the mainframe of the harmony blockchain, so the the native coding language for Harmony is Solidity

<img src="https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FKDHZL29b0iEPF3WFuNbv%2Fharmony-one-logo.svg?alt=media&#x26;token=d951810c-36e6-456a-a831-fbf4e6012625" alt="" data-size="original"><img src="https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2Fppl8SfDkrwiLqYoz3ez8%2FSolidity-Logo.wine.svg?alt=media&#x26;token=a92ef22b-6156-4fa3-b5e8-c7869b32eae9" alt="" data-size="original">

## Launch in <mark style="color:blue;">**10 minutes**</mark>

## <mark style="color:red;">**Workshop - Start**</mark>

**A.** *Open Remix IDE -->* [`REMIX`](https://remix.ethereum.org/#optimize=false\&runs=200\&evmVersion=null\&version=soljson-v0.8.7+commit.e28d00a7.js)

#### **B. Locate Contracts folder**

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2Fu4jW96Hu9G15bFYFmqK6%2FScreen%20Shot%202022-01-03%20at%205.01.41%20PM.png?alt=media\&token=f16712b5-eac3-42d2-b0c5-330da7c6b0db)Click on `contracts`

#### **C. Name your contract .sol file**

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FlqerZt8PmX4emlu5St6M%2FScreen%20Shot%202022-01-03%20at%205.03.53%20PM.png?alt=media\&token=5d7978ca-b138-43c2-b1de-553e554aecbe)Make a new file --> type `hrc20.sol`

#### **D.**  Write your Smart Contract&#x20;

Copy and paste this Text File into the IDE

{% file src="<https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2F43HIgT8CHAaUkrft7MLx%2Fhrc20-contract.txt?alt=media&token=a45dd187-08b6-452e-9c86-9764501fb0df>" %}
Copy the Contents of this File and paste them into the IDE to the right&#x20;
{% endfile %}

You will have a Full Contract with <mark style="color:green;">`//green comments`</mark> that explain everything. You are welcome to experiment and change the values as you see fit.&#x20;

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2F0qYZDG4N8L4asORFUDmy%2FScreen%20Shot%202022-01-03%20at%205.11.25%20PM.png?alt=media\&token=d6b3c754-fed3-4895-8980-6198f2a435e6)

## Compile 📝

#### E. Compile the Contract

#### &#x20;![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FVTu4PLRXplOexEl2FULj%2FScreen%20Shot%202022-01-03%20at%205.13.50%20PM.png?alt=media\&token=cdc355bd-dc82-4efa-b6a1-0562b03a7d18)Check Pragma and compiler version&#x20;

Typically you will configure your truffle or hardhat file that is in your code editor to choose the version of solidity you want to run. That is if you are testing and compiling the contract on your local test net.&#x20;

#### F. Use Meta Mask

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FrUCl32WxPFXvQEsJLAjS%2FScreen%20Shot%202022-01-03%20at%205.23.01%20PM.png?alt=media\&token=38d6660c-04a2-4a29-ab2b-cf6f940bf514)![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FZZhGdcnzZW464xUdYOlR%2FScreen%20Shot%202022-01-03%20at%205.24.13%20PM.png?alt=media\&token=dce50f33-be7b-424e-8358-ffc40b15a5f8)

You'll need to import [<mark style="color:orange;">**Meta Mask for Harmony**</mark>](https://docs.harmony.one/home/network/wallets/browser-extensions-wallets/metamask-wallet) <mark style="color:orange;">**-->**</mark>&#x20;

![Add a new Network --> type in these fields](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2F6Wa4sSBAEwKEtobs8jBz%2FScreen%20Shot%202022-01-03%20at%205.26.06%20PM.png?alt=media\&token=f8b64741-7ebd-42da-93ed-1b8dd0fd23b8)

## Deploy Contract

#### G. Write your contract

Before Transacting, make the contract unique to you. When you are ready, press <mark style="color:orange;">**Transact**</mark>&#x20;

![type in the fields before you transact](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FkZ2kz7Me2BvaMA0ElZ8D%2FScreen%20Shot%202022-01-03%20at%205.29.51%20PM.png?alt=media\&token=e69bbb3a-4122-4bd4-8844-68e2c954c60a)

In order to use Test Net you will need Test Tokens --> [Get Some HERE](https://faucet.pops.one/)

* *Copy and paste your MetaMask (0x...#) address and press 'send me'*

#### H. Confirm Transaction

![Confirm the Tx (transaction)](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2Fo6LAHFEOQKL5j5efnE11%2FScreen%20Shot%202022-01-03%20at%205.32.58%20PM.png?alt=media\&token=e004a7c1-5826-4a81-b192-52d4bb3a4cca)

#### I. Approve the Contract

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FWIBBjyCj0n0kSsiJxB1J%2FScreen%20Shot%202022-01-03%20at%205.38.41%20PM.png?alt=media\&token=c5282131-17de-462f-9659-05c1fc722924)

1. Copy and paste your address in the `_spender`
2. `_value` is the amount allowed to be transacted for any given transaction outside of your behalf. If you want to limit spending to 0, it will be **non-transferable;** as will `_value` 5000 will limit spending to 5k for others.&#x20;
3. `transfer` will send the currency too someone with a given value
4. `transferFrom` will send it from you, to someone else with a given amount.&#x20;
5. Blue buttons are your Contract <mark style="color:blue;">`Public`</mark> Variables&#x20;

## Importing your Token Meta Mask

Your friends may want to see their token creation. Just add the `Transaction` or `Ethereum hash` to <mark style="color:orange;">**MetaMask**</mark> by *importing a token*

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FmAZW8H7GR4wQOt6R71be%2FTx%20hash%20in%20the%20contract%20.png?alt=media\&token=500375e9-b1f9-40ad-bf2e-9a733860742c) First Transaction (Ethereum Hash)

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FOWaXVQnoYVp88Gyqn62W%2FFirst%20Contract%20Launch%20Eth%20Hash.png?alt=media\&token=a7ff0cf0-bc1e-4e7f-a7fd-8f41947b4a38) 0-0 launch --> (Transaction hash)

![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FYpBXMbYndPMiO2ALqDAX%2FScreen%20Shot%202022-01-03%20at%206.02.57%20PM.png?alt=media\&token=a8a2df25-e498-44c6-ae6a-0541b5cc1f02)copy and paste either of the above Tx's

### End of Lesson 1.1 - Harmony ONE/HRC-20 launch

If you've made it this far, congratulations. The process is pretty much the same for release mostly any contract. Using remix is a great way to get your feet wet using solidity. The real challenge is setting up your own environment to program an entire Dapp around your contract. This won't be done until you've practiced familiarizing yourself with the basics of Solidity. Your Goal would be to start learning contracts, and interacting with them using javascript. check the [full-stack-dapps](https://bridge-builders.gitbook.io/bbd/welcome-builder-start/full-stack-dapps "mention") section to practice making an entire web application.&#x20;

🥂\
Author, \
Dylan Kawalec --> [Linkedin](https://www.linkedin.com/in/dylankawalec/)\ <img src="https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FzeN0Wtf5vlJZn3YMP6ae%2FHeadshot%202.png?alt=media&#x26;token=6cb123fb-4551-42da-83d1-21fde8be3ae7" alt="" data-size="line"><br>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

\
\&#xNAN;*Thank you to the* [*<mark style="color:orange;">**@DoraFactory Foundation**</mark>*](https://hackerlink.io/) *for fundraising this bounty* \
![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FoFSUIDk5FUZUdIaUgX67%2FScreen%20Shot%202022-01-03%20at%206.58.45%20PM.png?alt=media\&token=b531650c-d91e-472e-985d-2b7dc7eac79b)\
![](https://2694531040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsRgJ1frKlPgHuUx5NCAS%2Fuploads%2FxeY4XLC8cJRITRxkbfod%2FScreen%20Shot%202022-01-03%20at%206.59.10%20PM.png?alt=media\&token=6b6864fc-4a7b-4fde-8d41-adab9f75c86a)[<mark style="color:blue;">**@Harmonyprotocol**</mark>](https://www.harmony.one/)&#x20;
