Skip to content

Commit 6239046

Browse files
committed
feat(contracts): npm package publication scripts, goerli cleanup, README population script
1 parent 8505c81 commit 6239046

32 files changed

+285
-8701
lines changed

contracts/.npmignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# NOP, just force npm to disregard .gitignore
2-
# https://docs.npmjs.com/cli/v9/using-npm/developers#keeping-files-out-of-your-package
1+
.env*
2+
scripts
3+
deploy
4+
tsconfig.json
5+
test
6+
hardhat.config.*

contracts/README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,44 @@
22

33
Smart contracts for Vea.
44

5-
## Deployed Addresses
5+
---
6+
7+
- **[Deployed Addresses](#deployed-addresses)**
8+
- **[Sepolia](#sepolia)**
9+
- **[Arbitrum Sepolia](#arbitrum-sepolia)**
10+
- **[Chiado](#chiado)**
11+
- **[Getting Started](#getting-started)**
12+
- **[Install the Dependencies](#install-the-dependencies)**
13+
- **[Run Tests](#run-tests)**
14+
- **[Compile the Contracts](#compile-the-contracts)**
15+
- **[Run Linter on Files](#run-linter-on-files)**
16+
- **[Deployment](#deployment)**
617

7-
Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh`.
18+
---
19+
20+
## Deployed Addresses
821

9-
### Current version
22+
Refresh the list of deployed contracts by running `./scripts/populateReadme.sh`.
1023

11-
#### Sepolia
24+
### Sepolia
1225

26+
- [RouterArbToGnosisDevnet](https://sepolia.etherscan.io/address/0xA699e7246D7AF936752789408A071805CC8c99c3)
27+
- [RouterArbToGnosisTestnet](https://sepolia.etherscan.io/address/0x22d70804d4Ef5BB206C6B39e3267DFe8a0f97d27)
1328
- [VeaOutboxArbToEthDevnet](https://sepolia.etherscan.io/address/0xb8BF3B6bd3E1a0Cc9E2dB77dd492503310514674)
29+
- [VeaOutboxArbToEthTestnet](https://sepolia.etherscan.io/address/0x209BFdC6B7c66b63A8382196Ba3d06619d0F12c9)
1430

15-
#### Arbitrum Sepolia
31+
### Arbitrum Sepolia
1632

1733
- [VeaInboxArbToEthDevnet](https://sepolia.arbiscan.io/address/0x0B5851fE2a931F619F73E739E5435C43976f1D68)
34+
- [VeaInboxArbToEthTestnet](https://sepolia.arbiscan.io/address/0xE12daFE59Bc3A996362d54b37DFd2BA9279cAd06)
35+
- [VeaInboxArbToGnosisDevnet](https://sepolia.arbiscan.io/address/0x496df82A2fE2f4aa6903C8bdcE759a94505E7D0c)
36+
- [VeaInboxArbToGnosisTestnet](https://sepolia.arbiscan.io/address/0x854374483572FFcD4d0225290346279d0718240b)
1837

19-
#### Chiado
38+
### Chiado
2039

2140
- [VeaInboxGnosisToArbDevnet](https://blockscout.com/gnosis/chiado/address/0xc0804E4FcEEfD958050356A429DAaaA71aA39385)
22-
- [VeaInboxGnosisToArbTestnet](https://blockscout.com/gnosis/chiado/address/0xC21c20a719fAc23c54c336FA0E16a0CFdC4baA00)
23-
- [VeaOutboxArbToGnosisDevnet](https://blockscout.com/gnosis/chiado/address/0x9481b3A49ac67d03D9022E6200eFD81850BADDB4)
24-
- [VeaOutboxArbToGnosisTestnet](https://blockscout.com/gnosis/chiado/address/0x931FA807020231bCE1340Be8E1e5054207BbAFEd)
41+
- [VeaOutboxArbToGnosisDevnet](https://blockscout.com/gnosis/chiado/address/0xAebcedf346f168E5CEaB7Cd367118d2176486ad7)
42+
- [VeaOutboxArbToGnosisTestnet](https://blockscout.com/gnosis/chiado/address/0x2f1788F7B74e01c4C85578748290467A5f063B0b)
2543

2644
## Getting Started
2745

@@ -74,7 +92,7 @@ The ones below are optional:
7492

7593
#### 1. Update the Constructor Parameters (optional)
7694

77-
If some of the constructor parameters (such as the Meta Evidence) needs to change, you need to update the files in the `deploy/` directory.
95+
If some of the constructor parameters needs to change, you need to update the files in the `deploy/` directory.
7896

7997
#### 2. Deploy to a Local Network
8098

@@ -111,13 +129,13 @@ yarn deploy --network arbitrum --tags ArbToGnosisInbox
111129
The deployed addresses should be output to the screen after the deployment is complete.
112130
If you miss that, you can always go to the `deployments/<network>` directory and look for the respective file.
113131

114-
#### Running Test Fixtures
132+
#### 4. Running Test Fixtures
115133

116134
```bash
117135
yarn test
118136
```
119137

120-
#### 4. Verify the Source Code
138+
#### 5. Verify the Source Code
121139

122140
This must be done for each network separately.
123141

contracts/README.md.template

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# @kleros/vea-contracts
2+
3+
Smart contracts for Vea.
4+
5+
---
6+
$toc
7+
---
8+
9+
## Deployed Addresses
10+
11+
Refresh the list of deployed contracts by running `./scripts/populateReadme.sh`.
12+
13+
$deployments
14+
15+
## Getting Started
16+
17+
### Install the Dependencies
18+
19+
```bash
20+
yarn install
21+
```
22+
23+
### Run Tests
24+
25+
```bash
26+
yarn test
27+
```
28+
29+
### Compile the Contracts
30+
31+
```bash
32+
yarn build
33+
```
34+
35+
### Run Linter on Files
36+
37+
```bash
38+
yarn check
39+
```
40+
41+
### Deployment
42+
43+
**NOTICE:** the commands below work only if you are inside the `contracts/` directory.
44+
45+
#### 0. Set the Environment Variables
46+
47+
Copy `.env.example` file as `.env` and edit it accordingly.
48+
49+
```bash
50+
cp .env.example .env
51+
```
52+
53+
The following env vars are required:
54+
55+
- `PRIVATE_KEY`: the private key of the deployer account used for the testnets.
56+
- `MAINNET_PRIVATE_KEY`: the private key of the deployer account used for Mainnet.
57+
- `INFURA_API_KEY`: the API key for infura.
58+
59+
The ones below are optional:
60+
61+
- `ETHERSCAN_API_KEY`: to verify the source of the newly deployed contracts on **Etherscan**.
62+
- `ARBISCAN_API_KEY`: to verify the source of the newly deployed contracts on **Arbitrum**.
63+
64+
#### 1. Update the Constructor Parameters (optional)
65+
66+
If some of the constructor parameters needs to change, you need to update the files in the `deploy/` directory.
67+
68+
#### 2. Deploy to a Local Network
69+
70+
```bash
71+
yarn start-local
72+
```
73+
74+
#### 3. Deploy to Public Networks
75+
76+
##### Testnets
77+
78+
```bash
79+
# arbitrumSepolia -> Sepolia
80+
yarn deploy --network sepolia --tags ArbSepoliaToSepoliaOutbox
81+
yarn deploy --network arbitrumSepolia --tags ArbSepoliaToSepoliaInbox
82+
83+
# arbitrumSepolia -> Chiado
84+
yarn deploy --network chiado --tags ArbSepoliaToChiadoOutbox
85+
yarn deploy --network arbitrumSepolia --tags ArbSepoliaToChiadoInbox
86+
```
87+
88+
##### Mainnets
89+
90+
```bash
91+
# Arbitrum -> Ethereum
92+
yarn deploy --network mainnet --tags ArbToEthOutbox
93+
yarn deploy --network arbitrum --tags ArbToEthInbox
94+
95+
# Arbitrum -> Gnosis chain
96+
yarn deploy --network gnosischain --tags ArbToGnosisOutbox
97+
yarn deploy --network arbitrum --tags ArbToGnosisInbox
98+
```
99+
100+
The deployed addresses should be output to the screen after the deployment is complete.
101+
If you miss that, you can always go to the `deployments/<network>` directory and look for the respective file.
102+
103+
#### 4. Running Test Fixtures
104+
105+
```bash
106+
yarn test
107+
```
108+
109+
#### 5. Verify the Source Code
110+
111+
This must be done for each network separately.
112+
113+
```bash
114+
# explorer
115+
yarn etherscan-verify --network <arbitrumSepolia|arbitrum|sepolia|mainnet|chiado|gnosischain>
116+
117+
# sourcify
118+
yarn sourcify --network <arbitrumSepolia|arbitrum|sepolia|mainnet|chiado|gnosischain>
119+
```

contracts/deploy/01-outbox/01-arb-sepolia-to-chiado-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55
import { ethers } from "hardhat";
66

77
enum ReceiverChains {

contracts/deploy/01-outbox/01-arb-sepolia-to-sepolia-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55
import { ethers } from "hardhat";
66

77
enum ReceiverChains {

contracts/deploy/01-outbox/01-arb-to-eth-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55
import { ethers } from "hardhat";
66

77
enum ReceiverChains {

contracts/deploy/01-outbox/01-arb-to-gnosis-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55
import { ethers } from "hardhat";
66

77
enum ReceiverChains {

contracts/deploy/01-outbox/01-chiado-to-arb-sepolia-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55
import { ethers } from "hardhat";
66

77
enum ReceiverChains {

contracts/deploy/01-outbox/01-gnosis-to-arb-outbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseEther } from "ethers";
22
import { HardhatRuntimeEnvironment } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "../../deploy-helpers/getContractAddress";
4+
import getContractAddress from "../utils/getContractAddress";
55

66
enum ReceiverChains {
77
ARBITRUM_SEPOLIA = 421614,

contracts/deploy/02-inbox/02-arb-to-gnosis-inbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import getContractAddress from "../../deploy-helpers/getContractAddress";
3+
import getContractAddress from "../utils/getContractAddress";
44

55
enum SenderChains {
66
ARBITRUM = 42161,

0 commit comments

Comments
 (0)