Skip to content

Latest commit

 

History

History

README.md

Introduction

Hopr-ethereum contains the on-chain logic that is used to process payments for HOPR.network on the Ethereum blockchain.

Table of Contents:

Requirements

Install

# 1. Installs dependancies
# 2. Runs linter
# 3. Compiles smart contracts
# 4. Generates smart contracts' typescript types
# 5. Compiles migrations to `.js`
yarn

Testing

# 1. Runs linter
# 2. Compiles smart contracts
# 3. Generates smart contracts' typescript types
# 4. Compiles migrations to `.js`
# 5. If ganache port is free, launches ganache or use an existing instance
# 6. Runs `truffle test`
yarn test

tip: we can use truffle's debug feature to seemingly debug our tests, take look at this example

Everytime yarn test is run, it makes sure to always regenerate typescript types before running the tests. If you want to generate types only, you can do it like this:

# 1. Runs linter
# 2. Compiles smart contracts
# 3. Generates smart contracts' typescript types
yarn build:sol

Coverage

# 1. Runs solidity-coverage
# 2. Stores result in `coverage` folder
yarn coverage

tip: see coverage results by launching ./coverage/index.html

Migrating

While migrations are implemented, setups for testnet/mainnet are not yet complete. You can run migrations by running your own in memory blockchain, for example:

npx truffle develop
yarn migrate

Contracts

HoprChannel

HoprToken

A standard ERC20 token with snapshot functionality.

Name: HOPR
Symbol: HOPR
Decimals: 18
Total Supply: 100,000,000