This repository contains smart contracts utilized by the Polkadot-Ethereum Bridge.
Make sure you use a recent node version, e.g. with nvm:
nvm install 20.4.5
nvm use 20.4.5
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
Run tests on the hardhat network:
npx hardhat test
Example: Deploy contracts to a local ganache instance
npx hardhat deploy --network localhost
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
You could also specify a solidity compile version for solidity-docgen.
npx solidity-docgen --solc-module solc-0.8
ABI for bindings can be generated with docker:
docker compose -f docker-compose-generate-abi.yml up
or with script, in this case make sure the project has been rebuilt
./scripts/update_abi.sh