Smart contracts for Kleros v2
Refresh the list of deployed contracts by running ./scripts/generateDeploymentsMarkdown.sh
.
- ArbitrableExample
- DisputeResolver
- DisputeTemplateRegistry
- ForeignGatewayOnGnosis
- SortitionSumTreeFactory
- TokenBridge
- WETH
- WETHFaucet
- WPNKFaucet
- WrappedPinakionV2
- xKlerosLiquidV2
- PNK
- ArbitrableExample
- BlockHashRNG
- DAI
- DAIFaucet
- DisputeKitClassic: proxy, implementation
- DisputeResolver
- DisputeTemplateRegistry: proxy, implementation
- EvidenceModule: proxy, implementation
- KlerosCore: proxy, implementation
- PNKFaucet
- PinakionV2
- PolicyRegistry: proxy, implementation
- RandomizerRNG: proxy, implementation
- SortitionModule: proxy, implementation
- WETH
- WETHFaucet
- ArbitrableExample
- DisputeResolver
- DisputeTemplateRegistry
- ForeignGatewayOnGnosis: proxy, implementation
- WETH
- WETHFaucet
- WPNKFaucet
- WrappedPinakionV2
- PNK
- ArbitrableExample
- BlockHashRNG
- DAI
- DAIFaucet
- DisputeKitClassic: proxy, implementation
- DisputeResolver
- DisputeTemplateRegistry: proxy, implementation
- EvidenceModule: proxy, implementation
- KlerosCore: proxy, implementation
- PNKFaucet
- PinakionV2
- PolicyRegistry: proxy, implementation
- RandomizerRNG: proxy, implementation
- SortitionModule: proxy, implementation
- WETH
- WETHFaucet
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.GNOSISSCAN_API_KEY
: to verify the source of the newly deployed contracts on Gnosis chain.
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 deploy --network localhost --tags <Arbitration|VeaMock|ForeignGatewayOnEthereum|HomeGateway>
# ArbitrumGoerli to Chiado
yarn deploy --network arbitrumGoerli --tags Arbitration
yarn deploy --network arbitrumGoerli --tags HomeArbitrable
yarn deploy --network chiado --tags ForeignGatewayOnGnosis
yarn deploy --network chiado --tags KlerosLiquidOnGnosis
yarn deploy --network chiado --tags ForeignArbitrable
yarn deploy --network arbitrumGoerli --tags HomeGatewayToGnosis
# Goerli
yarn deploy --network goerli --tags ForeignGatewayOnEthereum
yarn deploy --network goerli --tags ForeignArbitrable
yarn deploy --network arbitrumGoerli --tags HomeGatewayToEthereum
The deployed addresses should be displayed to the screen after the deployment is complete. If you missed them, you can always go to the deployments/<network>
directory and look for the respective file.
Same steps as above but append Devnet
to the --network
parameter.
Shell 1: the node
yarn hardhat node --tags Arbitration,VeaMock
Shell 2: the test scripts
yarn test --network localhost
This must be done for each network separately.
# explorer
yarn etherscan-verify --network <arbitrumGoerli|arbitrum|chiado|gnosischain|goerli|mainnet>
# sourcify
yarn sourcify --network <arbitrumGoerli|arbitrum|chiado|gnosischain|goerli|mainnet>
for network in mainnet gnosischain
do
yarn hardhat run scripts/getPoliciesV1.ts --network $network | tee config/policies.v1.$network.json
yarn hardhat run scripts/getCourtsV1.ts --network $network | tee config/courts.v1.$network.json
done
*.mainnet.json
. To populate from *.gnosischain.json
, set the variable USE_GNOSIS
to true inside scripts/populateCourts.ts.
TESTING_PARAMETERS
to true inside scripts/populateCourts.ts.
Shell 1:
yarn hardhat node --tags Arbitration
Shell 2:
yarn hardhat run scripts/populateCourts.ts --network localhost
yarn hardhat run scripts/populatePolicyRegistry.ts --network localhost
yarn hardhat run scripts/populateCourts.ts --network arbitrumGoerli
yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumGoerli
scripts/generateDeploymentArtifact.sh <network> <address>
scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f3cfda759a9d9 > deployments/gnosischain/WETH.json
Ensure that your $TENDERLY_PROJECT
and $TENDERLY_USERNAME
is set correctly in .env
.
yarn tenderly-verify --network goerli
yarn tenderly-verify --network arbitrumGoerli