Skip to content

Latest commit

 

History

History
executable file
·
93 lines (63 loc) · 2.88 KB

README.md

File metadata and controls

executable file
·
93 lines (63 loc) · 2.88 KB

HOPR net

HOPR is a privacy-preserving messaging protocol that incentivizes users to participate in the network. It provides privacy by relaying messages via several relay nodes to the recipient. Relay nodes are getting paid via payment channels for their services.

hopr-ethereum

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

Table of Contents

Requirements

Install

# 1. Installs dependancies
yarn

Build

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

Testing

# Runs `truffle test`
yarn test

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

Coverage

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

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

Migrating

For public network migrations (rinkeby, kovan, etc), you will have to create a .env file within the root directory of this project.

yarn network # starts a locally hosted network
yarn migrate

# deploying smart contract on a public network
yarn migrate --network matic

Audit

The HoprToken and HoprDistributor contracts are currently being audited.

You can find some early feedback over at bokkypoobah/HoprTokenAudit.

See audit scope here.

Linting

We use solhint's default preset to perform linting onto our smart contracts.

Future Improvements

  • ganache-cli-coverage: eventually we would like to switch to ganache-core-coverage once it matures enough. #issue

  • redundant compiles: when running yarn test or yarn coverage, we always make sure to generate the latest typescript types, this requires us to compile the contracts. Internally, both scripts use truffle test which recompiles the contracts even though they haven't changed. #issue #solution