Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 1.93 KB

README.md

File metadata and controls

81 lines (55 loc) · 1.93 KB

Ethereum Contracts

This directory contains smart contracts utilized by the Polkadot-Ethereum Bridge.

Development

Requirements:

Install dependencies with yarn:

yarn install

Create an .env file using the env.template as a template. Note that deploying to ropsten network requires setting the INFURA_PROJECT_ID and ROPSTEN_PRIVATE_KEY environment variables.

Example:

cp env.template .env

Testing

Run tests on the hardhat network:

yarn test

Deployment

Local

Example: Run a local hardhat instance with deployments

yarn hardhat node

Ropsten, Mainnet

yarn hardhat deploy --network ropsten

Tasks

Upgrade an app

Example: upgrade an app to use a different set of channels

# Do something first to deploy new channels, then provide addresses below
yarn hardhat upgrade \
  --appaddr       0x3f0839385DB9cBEa8E73AdA6fa0CFe07E321F61d \
  --basicinbound  0x0000000000000000000000000000000000000001 \
  --basicoutbound 0x0000000000000000000000000000000000000002 \
  --incinbound    0x0000000000000000000000000000000000000003 \
  --incoutbound   0x0000000000000000000000000000000000000004 \
  --network       localhost # change to ropsten or mainnet accordingly

Renounce ownership of the CHANNEL_UPGRADE_ROLE

yarn hardhat renounce \
  --appaddr 0x3f0839385DB9cBEa8E73AdA6fa0CFe07E321F61d \
  --network localhost

Autogenerated Documentation

Solidity documentation can be autogenerated using the solidity-docgen library. It will generate markdown files from the contracts directory and output them to the docs directory.

# The library is only compatible with npx
npx solidity-docgen