|
| 1 | +# @kleros/kleros-v2-contracts |
| 2 | + |
| 3 | +Smart contracts for Kleros v2 |
| 4 | + |
| 5 | +## Deployed Addresses |
| 6 | + |
| 7 | +### Contract 1 |
| 8 | + |
| 9 | +- Mainnet: ... |
| 10 | +- Testnet: ... |
| 11 | + |
| 12 | +### Contract 2 |
| 13 | + |
| 14 | +... |
| 15 | + |
| 16 | +## Contributing |
| 17 | + |
| 18 | +### Install Dependencies |
| 19 | + |
| 20 | +```bash |
| 21 | +yarn install |
| 22 | +``` |
| 23 | + |
| 24 | +### Run Tests |
| 25 | + |
| 26 | +```bash |
| 27 | +yarn test |
| 28 | +``` |
| 29 | + |
| 30 | +### Compile the Contracts |
| 31 | + |
| 32 | +```bash |
| 33 | +yarn build |
| 34 | +``` |
| 35 | + |
| 36 | +### Run Linter on Files |
| 37 | + |
| 38 | +```bash |
| 39 | +yarn lint |
| 40 | +``` |
| 41 | + |
| 42 | +### Fix Linter Issues on Files |
| 43 | + |
| 44 | +```bash |
| 45 | +yarn fix |
| 46 | +``` |
| 47 | + |
| 48 | +### Deploy Instructions |
| 49 | + |
| 50 | +**NOTICE:** the commands below work only if you are inside the `contracts/` directory. |
| 51 | + |
| 52 | +#### 0. Set the Environment Variables |
| 53 | + |
| 54 | +Copy `.env.example` file as `.env` and edit it accordingly. |
| 55 | + |
| 56 | +```bash |
| 57 | +cp .env.example .env |
| 58 | +``` |
| 59 | + |
| 60 | +The following env vars are required: |
| 61 | + |
| 62 | +- `PRIVATE_KEY`: the private key of the deployer account used for xDAI, Sokol and Kovan. |
| 63 | +- `MAINNET_PRIVATE_KEY`: the private key of the deployer account used for Mainnet. |
| 64 | +- `INFURA_API_KEY`: the API key for infura. |
| 65 | + |
| 66 | +The ones below are optional: |
| 67 | + |
| 68 | +- `ETHERSCAN_API_KEY`: used only if you wish to verify the source of the newly deployed contracts on Etherscan. |
| 69 | + |
| 70 | +#### 1. Update the Constructor Parameters (optional) |
| 71 | + |
| 72 | +If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the `deploy/` directory. |
| 73 | + |
| 74 | +#### 2. Deploy the Proxies |
| 75 | + |
| 76 | +```bash |
| 77 | +yarn deploy:staging # to deploy to L1/L2 testnet |
| 78 | +# yarn deploy:production # to deploy to L1/L2 mainnet |
| 79 | +``` |
| 80 | + |
| 81 | +The deployed addresses should be output to the screen after the deployment is complete. |
| 82 | +If you miss that, you can always go to the `deployments/<network>` directory and look for the respective file. |
| 83 | + |
| 84 | +#### 3. Verify the Source Code for Contracts |
| 85 | + |
| 86 | +This must be done for each network separately. |
| 87 | + |
| 88 | +For `Kovan` or `Mainnet` you can use the `etherscan-verify` command from `hardhat`: |
| 89 | + |
| 90 | +```bash |
| 91 | +yarn hardhat --network <kovan|mainnet> etherscan-verify |
| 92 | +``` |
| 93 | + |
| 94 | +For `Sokol` and `xDAI` the process currently must be done manually through [Blockscout](https://blockscout.com/). |
0 commit comments