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
2020-05-17 17:57:49 +03:00
.circleci Fix some of the possibles failure reasons in e2e tests (#294) 2020-02-11 20:50:34 +03:00
audit Security audit report provided by Quantstamp for TokenBridge contracts (#263) 2020-01-10 15:48:41 +03:00
burner-wallet-plugin Add Burner Wallet Plugin for WETC Bridge (#306) 2020-05-04 23:35:46 +03:00
commons Add e2e tests two tokens support 2019-12-02 17:20:53 -03:00
contracts@a7ce4441ab Update the contract's submodule to the release 5.0.0-rc0 (#321) 2020-05-05 20:03:12 +03:00
deployment Cache monitor RPC calls to increase performance (#322) 2020-05-07 20:42:27 +03:00
deployment-e2e Use oracle docker hub image for oracle deployment (#280) 2020-02-04 00:48:28 +03:00
e2e-commons Cache monitor RPC calls to increase performance (#322) 2020-05-07 20:42:27 +03:00
monitor Return back filter for tx with TokensSwapped (#335) 2020-05-17 17:57:49 +03:00
monitor-e2e Update contract's submodule and e2e tests (#313) 2020-04-24 21:01:07 +03:00
oracle Composer files to build oracle and monitor docker images (#299) 2020-02-21 16:58:05 +03:00
oracle-e2e Update contract's submodule and e2e tests (#313) 2020-04-24 21:01:07 +03:00
parity Correct handling of Chai to Dai swaps in oracle and monitor components (#302) 2020-03-13 01:12:48 +03:00
ui Updated links to new repo with tokenbridge contracts (#226) 2019-11-05 15:53:47 +03:00
ui-e2e Update metamask extension in ui e2e tests (#297) 2020-02-20 22:13:18 +03:00
.coveralls.yml Added Coveralls for UI (#59) 2019-05-22 16:09:02 +02:00
.dockerignore Upgrade minimist and kind-of dependencies (#325) 2020-05-08 20:14:06 +03:00
.editorconfig Move .editorconfig to root dir. 2019-05-22 16:33:28 +02:00
.eslintignore Add Burner Wallet Plugin for WETC Bridge (#306) 2020-05-04 23:35:46 +03:00
.eslintrc Configured Prettier (#60) 2019-05-22 16:31:09 +02:00
.gitignore Add Burner Wallet Plugin for WETC Bridge (#306) 2020-05-04 23:35:46 +03:00
.gitmodules Updated links to new repo with tokenbridge contracts (#226) 2019-11-05 15:53:47 +03:00
.nvmrc Update the contract's submodule to a commit-predecessor of 3.1.0 (#214) 2019-09-17 10:56:29 +03:00
.prettierrc Extend line width to 120 (#174) 2019-08-01 15:10:22 +02:00
CODE_OF_CONDUCT.md Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
CONFIGURATION.md Cache monitor RPC calls to increase performance (#322) 2020-05-07 20:42:27 +03:00
CONTRIBUTING.md Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
Dockerfile.e2e Monitor E2E rewrite (#187) 2019-08-27 16:26:49 +02:00
LICENSE Update the token-bridge sub-repo (#19) 2019-05-07 16:52:44 +02:00
package.json Upgrade minimist and kind-of dependencies (#325) 2020-05-08 20:14:06 +03:00
README.md Composer files to build oracle and monitor docker images (#299) 2020-02-21 16:58:05 +03:00
yarn.lock Upgrade minimist and kind-of dependencies (#325) 2020-05-08 20:14:06 +03:00

CircleCI Gitter License: LGPL v3.0

Tokenbridge

Welcome to the POA TokenBridge monorepository!

Please note that this repository as a work in progress.

Overview

The POA TokenBridge 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 TokenBridge 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
Deployment-E2E End to end tests for the Deployment
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 TokenBridge
xDai Bridge Thunder bridge
WETC Bridge Volta TokenBridge & 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 four 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
  • Arbitrary-Message: Transfer arbitrary data between two networks as so the data could be interpreted as an arbitrary contract method invocation.

Initializing the monorepository

Clone the repository:

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

If there is no need to build docker images for the TokenBridge components (oracle, monitor, UI), initialize submodules, install dependencies, compile the Smart Contracts:

yarn initialize

Then refer to the corresponding README files to get information about particular TokenBridge component.

Linting

Running linter for all JS projects:

yarn lint

Tests

Running tests for all projects:

yarn test

Additionally 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. Configuration details are available here.

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