Development has moved to hoprnet/hoprnet
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 of the project, this file allows you to use your own mnemonic and infura api key securely.
yarn network # starts a locally hosted network
yarn migrate
A standard ERC777 token with snapshot functionality.
Name: HOPR Token
Symbol: HOPR
Decimals: 18
Total Supply: 100,000,000
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 -
patch-typechain: ganache-core uses wrong Web3 types. #issue
-
patch-truffle-typings: truffle-typings does not fully support Truffle v5 yet. #issue
-
patch-typechain: typechain does not fully support Truffle v5 yet. #issue