Mono repository of Token Bridge (Oracle, Deployment, Monitor). TokenBridge is an interoperability solution between EVM-based networks for assets/data cross chain transfers
Go to file
2019-08-20 15:19:09 -03:00
.circleci First step of ultimate e2e testing (#155) 2019-07-17 10:14:58 +02:00
audit/peppersec Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
commons Move amb message utils to commons 2019-07-25 12:36:10 -03:00
contracts@1987b9ab28 Update contract submodule 2019-08-20 15:19:09 -03:00
deployment Update deployment oracle template 2019-07-23 11:35:54 -03:00
e2e-commons Fix e2e-commons up script 2019-07-17 12:03:29 -03:00
monitor Fix amb monitor 2019-07-30 10:05:44 -03:00
monitor-e2e Monitor - E2E (#112) 2019-06-27 09:57:45 +02:00
oracle Move amb message utils to commons 2019-07-25 12:36:10 -03:00
oracle-e2e Oracle amb merge fix 2019-07-17 11:47:25 -03:00
parity Single parity dockerfile 2019-05-21 12:43:59 +02:00
ui UI using Commons (#145) 2019-07-15 18:07:11 +02:00
ui-e2e Grouped ui-e2e tests (#148) 2019-07-15 09:22:16 +02:00
.coveralls.yml Added Coveralls for UI (#59) 2019-05-22 16:09:02 +02:00
.dockerignore Ignoring images only in the oracle 2019-05-23 14:04:41 +02:00
.editorconfig Move .editorconfig to root dir. 2019-05-22 16:33:28 +02:00
.eslintignore Configured Prettier (#60) 2019-05-22 16:31:09 +02:00
.eslintrc Configured Prettier (#60) 2019-05-22 16:31:09 +02:00
.gitignore Role rework plus deployment tests (#116) 2019-07-02 13:10:46 +02:00
.gitmodules Removed contracts-2.2.0 module 2019-05-24 10:49:20 +02:00
.nvmrc Consolidated .nvmrc 2019-05-22 16:31:45 +02:00
.prettierrc Fix prettier 2019-07-25 15:28:36 -03:00
CODE_OF_CONDUCT.md Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
CONTRIBUTING.md Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
Dockerfile.e2e UI in docker (#102) 2019-06-14 15:50:22 +02:00
LICENSE Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
package.json Update contract module name 2019-07-18 09:04:10 -03:00
README.md Added Commons sub-repository (#139) 2019-07-11 15:46:52 +02:00
yarn.lock Fix prettier 2019-07-25 15:28:36 -03:00

CircleCI Gitter License: LGPL v3.0

Tokenbridge

Welcome to the POA Token Bridge monorepository!

Please note that this repository as a work in progress.

Overview

The POA Token Bridge allows users to transfer assets between two chains in the Ethereum ecosystem. It is composed of several elements which are contained within this monorepository.

For a complete picture of the POA Token Bridge functionality, it is useful to explore each subrepository.

Structure

Sub-repositories maintained within this monorepo are listed below.

Sub-repository Description
Oracle Oracle responsible for listening to bridge related events and authorizing asset transfers.
UI DApp interface to transfer tokens and coins between chains.
Monitor Tool for checking balances and unprocessed events in bridged networks.
Deployment Ansible playbooks for deploying cross-chain bridges.
Oracle-E2E End to end tests for the Oracle
Monitor-E2E End to end tests for the Monitor
UI-E2E End to end tests for the UI
Commons Interfaces, constants and utilities shared between the sub-repositories
E2E-Commons Common utilities and configuration used in end to end tests

Additionally there are Smart Contracts used to manage bridge validators, collect signatures, and confirm asset relay and disposal.

Available deployments

Launched by POA Launched by 3rd parties
POA20 Bridge Ocean Token Bridge
xDai Bridge Thunder bridge
WETC Bridge Volta Token Bridge & DAI bridge to Volta Chain
Artis Brige
Tenda bridge & xDai-to-Tenda bridge

Network Definitions

Bridging occurs between two networks.

  • Home - or Native - is a network with fast and inexpensive operations. All bridge operations to collect validator confirmations are performed on this side of the bridge.

  • Foreign can be any chain; generally it refers to the Ethereum mainnet.

Operational Modes

The POA TokenBridge provides three operational modes:

  • Native-to-ERC20 Coins on a Home network can be converted to ERC20-compatible tokens on a Foreign network. Coins are locked on the Home side and the corresponding amount of ERC20 tokens are minted on the Foreign side. When the operation is reversed, tokens are burnt on the Foreign side and unlocked in the Home network. More Information: POA-to-POA20 Bridge
  • ERC20-to-ERC20 ERC20-compatible tokens on the Foreign network are locked and minted as ERC20-compatible tokens (ERC677 tokens) on the Home network. When transferred from Home to Foreign, they are burnt on the Home side and unlocked in the Foreign network. This can be considered a form of atomic swap when a user swaps the token "X" in network "A" to the token "Y" in network "B". More Information: ERC20-to-ERC20
  • ERC20-to-Native: Pre-existing tokens in the Foreign network are locked and coins are minted in the Home network. In this mode, the Home network consensus engine invokes Parity's Block Reward contract to mint coins per the bridge contract request. More Information: xDai Chain

Initializing the monorepository

Clone the repository:

git clone https://github.com/poanetwork/tokenbridge

Initialize submodules, install dependencies, compile the Smart Contracts:

yarn initialize

Linting

Running linter for all JS projects:

yarn lint

Tests

Running tests for all projects:

yarn test

Additionaly there are end-to-end tests for Oracle and UI.

For details on building, running and developing please refer to respective READMEs in sub-repositories.

Building, running and deploying

Please refer to the instructions in sub-directories.

Contributing

See the CONTRIBUTING document for contribution, testing and pull request protocol.

License

This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.

References