Welcome to the Gnosis Chain TokenBridge monorepository!
Please note that this repository as a work in progress.
The Gnosis Chain TokenBridge allows users to transfer assets between Ethereum and Gnosis Chain. It is composed of several elements which are contained within this monorepository.
For a complete picture of the Gnosis Chain TokenBridge functionality, it is useful to explore each subrepository.
Sub-repositories maintained within this monorepo are listed below.
Only Oracle folder is actively maintained at the moment.
Sub-repository | Description |
---|---|
Oracle | Responsible for listening to bridge related events and authorizing asset transfers. |
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 |
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 |
ALM | DApp interface tool for AMB Live Monitoring |
Burner-wallet-plugin | TokenBridge Burner Wallet 2 Plugin |
Additionally there are Smart Contracts used to manage bridge validators, collect signatures, and confirm asset relay and disposal.
https://bridge.gnosischain.com/
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; generally it refers to the Gnosis Chain.
-
Foreign can be any chain; generally it refers to the Ethereum mainnet.
The Gnosis Chain TokenBridge provides two operational modes:
-
ERC20-to-Native
: DAI token in the Ethereum are locked and xDAI are minted in the Gnosis Chain. In this mode, the Gnosis Chain consensus engine invokes Parity's Block Reward contract to mint coins per the bridge contract request. -
Arbitrary-Message
: Transfer arbitrary data between two networks as so the data could be interpreted as an arbitrary contract method invocation.
Clone the repository:
git clone https://github.com/gnosischain/tokenbridge.git
If there is no need to build docker images for the TokenBridge components (oracle, monitor), install dependencies, compile the smart contracts:
yarn initialize
Then refer to the corresponding README files to get information about particular TokenBridge component.
While installing dependencies, you may encounter a node-gyp error due to the use of an older Node.js version. This issue does not impact the core functionality of the project. You can proceed with compiling the smart contracts without any concerns.
Running linter for all JS projects:
yarn lint
Running tests for all projects:
yarn test
Additionally there are end-to-end tests for Oracle and Monitor.
For details on building, running and developing please refer to respective READMEs in sub-repositories.
Please refer to the instructions in sub-directories. Configuration details are available here.
See the CONTRIBUTING document for contribution, testing and pull request protocol.
This project is licensed under the GNU Lesser General Public License v3.0. See the LICENSE file for details.