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 contains the on-chain logic that is used to process payments for hoprnet.org on the Ethereum blockchain.
# 1. Installs dependancies
yarn
# 1. Runs linter
# 2. Compiles smart contracts
# 3. Generates smart contracts' typescript types
# 4. Compiles migrations to `.js`
yarn build
# Runs `truffle test`
yarn test
tip: we can use truffle's debug feature to seemingly debug our tests, take look at this example
# 1. Runs solidity-coverage
# 2. Stores result in `coverage` folder
yarn coverage
tip: see coverage results by launching
./coverage/index.html
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
The HoprToken
and HoprDistributor
contracts are currently being audited.
You can find some early feedback over at bokkypoobah/HoprTokenAudit.
See audit scope here.
We use solhint's default preset to perform linting onto our smart contracts.
-
ganache-cli-coverage: eventually we would like to switch to ganache-core-coverage once it matures enough. #issue
-
redundant compiles: when running
yarn test
oryarn coverage
, we always make sure to generate the latest typescript types, this requires us to compile the contracts. Internally, both scripts usetruffle test
which recompiles the contracts even though they haven't changed. #issue #solution