Skip to content
An exploration showing how to create tokens on AMB-NET and use them on side-chains.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Common
Contracts
Dashboard
Oracle
Wallet
bin
multi-node
.gitignore
LICENSE
README.md
Sidechannel+PoC+documentation.pdf
package-lock.json
package.json

README.md

Bridged token PoC

Overview

This repository contains a PoC implementation of a bridged ERC20 token. The token is created on a main network and can be converted to a native (e.g. ETH, AMB) token in a sidechanel.

The detailed documenation about this PoC and it's architecture is provided in Sidechannel+PoC+documentation.pdf.

Running the PoC

  1. Install dependencies using npm install
  2. Start two blockchain networks (main and side) using npm run network
  3. Now, start the Dashboard using npm run dashboard. By default the dashboard starts at localhost:8080

The Dashboard is a basic web application that allows you to create connections between networks and to deploy ERC20 tokens. Potentially sidechannel deployment can be handled by smart contracts in AMB-NET (see "Appendix A" in Sidechannel+PoC+documentation.pdf). The PoC simply uses the two launched networks.

  1. From the dashboard you can create the bridge, which will connect the two networks.

In the Create bridge section of the dashboard enter the URL of a sidechain node (ws://localhost:8548 by default) and click "Submit" Common/img/img1.png

  1. Once the bridge is deployed, addresses of the bridge smart contracts will be shown.
  2. Open Oracle/Oracle.conf and enter the bridge smart contract addresses into the configuration file (the bridge section).

Note that addresses of the two smart contracts may end up the same since the contracts are on different networks.

  1. Now, open a new terminal and launch the oracle using npm run oracle. At this point the two networks are connected by a bridge through the oracle.
  2. Using the dashboard, You can create a bridged ERC20 token to test out the connection.

In the Create token section of the dashboard enter the details of your token and click "Submit". Common/img/img2.png

  1. Once the token is deployed, addresses of token smart contracts will be shown.

  2. Open Wallet/Wallet.conf and enter the bridge smart contract addresses into the configuration file (the token section). This step is similar to step 6.

  3. Now, open a new (third) terminal and launch the wallet web app using npm run wallet. Note: it is necessary to open many terminals if you want to see log output from each process. Realistically, these components are meant to be deployed on separate servers. If you don't want to see log output, you can launch processes in the background e.g. npm run wallet &

From the wallet you can transfer tokens between accounts in your sidechain and convert these tokens into tokens from the mainnet and back. (see Sidechannel+PoC+documentation.pdf for detailed usage scenarios) Common/img/img5.png Common/img/img3.png Common/img/img4.png

You can’t perform that action at this time.