payments-smart-contracts icon indicating copy to clipboard operation
payments-smart-contracts copied to clipboard

Smart contracts for payments flow

Mysterium Network payments Build Status

Set of smart contracts needed for mysterium identity registration and working with payment channels (using payment hubs).

Documentation

  • Payments solution white paper
  • Smart contracts API description
  • Requirements/prerequisites of payment solution
  • Registration flow (technical)

Setup and test

We're using truffle for smart contract compilation and running tests.

  1. Install dependencies
npm install
  1. Run local ethereum node, e.g. ganache. Make sure to use version greater than 6.12.2.
npx ganache-cli --port 8545 --mnemonic "amused glory pen avocado toilet dragon entry kitchen cliff retreat canyon danger"
  1. Run tests
npm test
  1. Testing migration/deployment
npm run migrate

MainNet deployment

Registry smart contract:

Hermes smart contract

Implementation addresses:

  • Hermes implementation address (same on both networks): 0x213a1B1d08F2715aE054ade98DEEd8a8F1cc937E
  • Hermes implementation v3 address (Polygon only): 0x4f7265afc1373317975a306023574BE5Ec87157A
  • Channel implementation address (Polygon): 0x25882f4966065ca13b7bac15cc48391d9a4124f6
  • Channel implementation v2 address (Polygon): 0x813d3A0ef42FD4F25F2854811A64D5842EF3F8D1
  • Channel implementation v3 address (Polygon): 0x6b423D3885B4877b5760E149364f85f185f477aD
  • Channel implementation address (Ethereum): 0xBd20839B331A7A8d10e34CDf7219edf334814c4f

Testnet3 deployment (ethereum Görli and polygon Mumbai testnets)

MYSTT test token:

Registry smart contract:

Hermes smart contract:

Implementation addresses:

  • Hermes implementation address (same on both networks): 0x72227c86B8B6C0cA292C3631679a5DdB20433cb3
  • Channel implementation address (Görli): 0x1aDF7Ef34b9d48DCc8EBC47D989bfdE55933B6ea
  • Channel implementation address (Mumbai): 0xf8982Ba93D3d9182D095B892DE2A7963eF9807ee
  • Hermes implementation address (Mumbai v3): 0xaC69E0C98A688E35698630Eb0c741eB2A2fc5eF1
  • Channel implementation address (Mumbai v3): 0x6FE3E5e5008e49821BF7282870eC831BA9694dDB

All v3 related Smart Contracts are deployed by Hermes Operator

Building golang bindings

To be able easily call these smart contract out of any software writen in Go you need to generate golang bindings and import payments package into your software.

  1. Tag newest version of smart contracts on GitHub
  2. CI will build artifacts
  3. Go to payments repo and in go.gen set tag and which artifacts to build.
  4. Run mage generate.