Skip to content

Latest commit

 

History

History
90 lines (62 loc) · 2.16 KB

README.md

File metadata and controls

90 lines (62 loc) · 2.16 KB

Ethereum Contracts

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

Development

Requirements:

Install dependencies with yarn:

yarn install

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

Example:

cp .envrc-example .envrc
direnv allow

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

View the address of deployed contract's

yarn hardhat  contractAddressList \
  --network localhost # change to ropsten or mainnet accordingly

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