Smart contracts for Kleros v2
Refresh the list of deployed contracts by running ./scripts/generateDeploymentsMarkdown.sh
.
- PNK
- ConstantNG
- DisputeKitClassic
- FastBridgeSender
- HomeGateway
- IncrementalNG
- KlerosCore
- SafeBridgeArbitrum
- SortitionSumTreeFactory
yarn install
yarn test
yarn build
yarn lint
yarn fix
NOTICE: the commands below 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 the testnets.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
: to verify the source of the newly deployed contracts on Etherscan.ARBISCAN_API_KEY
: to verify the source of the newly deployed contracts on Arbitrum.
If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the deploy/
directory.
The complete deployment is multi-chain, so a deployment to the local network can only simulate either the Home chain or the Foreign chain.
Shell 1: the node
yarn hardhat node --tags nothing
Shell 2: the deploy script
yarn hardhat deploy --network localhost --tags HomeChain
# To deploy on L2 only
yarn hardhat deploy --network arbitrumRinkeby --tags HomeChain
# To deploy on L1 only
yarn hardhat deploy --network rinkeby --tags ForeignChain
# To deploy both L1 and L2
yarn deploy:staging
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.
Shell 1: the node
yarn hardhat node --tags Arbitration,ForeignGateway,HomeGateway
Shell 2: the test script
yarn hardhat test --network localhost test/pre-alpha1/index.ts
This must be done for each network separately.
yarn hardhat --network <arbitrumRinkeby|arbitrum|rinkeby|mainnet> etherscan-verify