Smart contracts to enable cross-chain arbitration for Sundial
- Mumbai: deployment.
- Polygon: deployment.
- goerli: deployment.
- Mainnet: deployment.
yarn install
yarn test
yarn build
yarn lint
yarn fix
IMPORTANT: new versions of any of the contracts require publishing both Home and Foreign proxies, as their binding is immutable.
NOTICE: the commands bellow work only if you are inside the contracts/
directory.
Copy .env.example
file as .env
and edit it accordingly.
cp .env.example .env
The following env vars are required:
PRIVATE_KEY
: the private key of the deployer account used for xDAI, Sokol and Kovan.MAINNET_PRIVATE_KEY
: the private key of the deployer account used for Mainnet.INFURA_API_KEY
: the API key for infura.
The ones below are optional:
ETHERSCAN_API_KEY
: used only if you wish to verify the source of the newly deployed contracts on Etherscan.
If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the deploy/
directory.
yarn deploy:staging # to deploy to Mumbai/Goerli
# yarn deploy:production # to deploy to Polygon/Mainnet
The deployed addresses should be output to the screen after the deployment is complete.
If you miss that, you can always go to the deployments/<network>
directory and look for the respective file.
This must be done for each network separately.
For Goerli
or Mainnet
you can use the etherscan-verify
command from hardhat
:
yarn hardhat --network <mumbai|polygon|goerli|mainnet> etherscan-verify
Note: For Polygon Mainnet and Mumbai testnet a separate ETHERSCAN_API_KEY is required created on https://polygonscan.com