Home

Awesome

Build Status

POA bridge smart contracts

The goal of these contracts is to allow users to tokenize native POA coin into ERC20 token on ethereum mainnet. Home Bridge is a smart contract that should be deployed in POA.network Foreign Bridge is a smart contract that should be deployed in Ethereum Mainnet

Responsibilities and roles of the bridge:

Dependencies

npm install

To Deploy

Check truffle.js for networks and their ports

NETWORK=sokol npm run deploy

Manual Deployment steps

Home Deployment(Sokol)

  1. Deploy EternalStorageProxy contract (Example address: '0x01') that will be used as Home Bridge Validators Proxy contract
  2. Deploy BridgeValidators contract (Example address: '0x02')
  3. Call upgradeTo of EternalStorageProxy that is used as Home Bridge Validators with 2 parameters:
  1. Call initialize method at Home Bridge Validators Proxy(0x01) with 2 parameters:
  1. Deploy Home Bridge. Example address: 0x03
  2. Deploy EternalStorageProxy contract that will be used as Home Bridge Proxy contract. Example address: 0x04
  3. Call upgradeTo of EternalStorageProxy that is used as Home Bridge Proxy(step#6) with 2 parameters:
  1. Call initialize method at Home Bridge Proxy address with 4 parameters:

Foreign Deployment on Kovan

=====

  1. Deploy POA20 contract Example(0x05)
  2. Deploy EternalStorageProxy contract that will be used as Foreign Bridge Validators Proxy contract. Example 0x06
  3. Deploy BridgeValidators contract Example 0x07
  4. Call upgradeTo of EternalStorageProxy(0x06) that is used as Foreign Bridge Validators Proxy(step#10) with 2 parameters:
  1. Call initialize method at Foreign Bridge Validators Proxy(0x06) with 2 parameters:
  1. Deploy EternalStorageProxy contract that will be used as Foreign Bridge Proxy contract. Example 0x08
  2. Deploy Foreign Bridge contract Example 0x09
  3. Call upgradeTo of EternalStorageProxy(0x08) that is used as Foreign Bridge Proxy(step#14) with 2 parameters:
  1. Call initialize method at Foreign Bridge Proxy(0x08) address with 5 parameters:
  1. Call transferOwnership of POA20 contract(0x05) with 1 parameter:

To Flatten

npm run flatten