Skip to content

Commit c260ea8

Browse files
authored
Merge pull request #510 from kleros/feat(web)/demo-staging
Feb demo - Integration
2 parents 5165a28 + ecb6a12 commit c260ea8

File tree

197 files changed

+35786
-14359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+35786
-14359
lines changed

.github/workflows/codeql-analysis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
disable-sudo: true
4747
egress-policy: block
4848
allowed-endpoints: >
49+
objects.githubusercontent.com:443
4950
uploads.github.com:443
5051
api.github.com:443
5152
github.com:443

.github/workflows/sentry-release.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Sentry Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
permissions: # added using https://github.com/step-security/secure-workflows
10+
contents: read
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
environment: Master
16+
outputs:
17+
version: ${{ steps.set-version.outputs.version }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: 16
25+
26+
- name: Install dependencies
27+
run: yarn workspace @kleros/kleros-v2-web install
28+
29+
- name: Build and deploy subgraph
30+
run: yarn @kleros/kleros-v2-web build
31+
32+
- name: Set version
33+
id: set-version
34+
run: echo "version=v$(cat package.json | jq -r .version)-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
35+
working-directory: web
36+
37+
- name: Create Sentry release
38+
uses: getsentry/[email protected]
39+
env:
40+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
41+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
42+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
43+
with:
44+
environment: production
45+
version: ${{ steps.set-version.outputs.version }}
46+
sourcemaps: ./web/dist
47+

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,6 @@ tags
200200
# subgraph
201201
subgraph/generated/*
202202
subgraph/build/*
203+
204+
# Local Netlify folder
205+
.netlify

contracts/.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
66
# If ETHERSCAN_API_KEY is set, it overrides any hardhat configuration.
77
ETHERSCAN_API_KEY_FIX=ABC123ABC123ABC123ABC123ABC123ABC1
88
ARBISCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
9+
GNOSISSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
910

1011
# Optionally for debugging
1112
# TENDERLY_USERNAME=your_username

contracts/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Hardhat files
22
cache
3+
cache_hardhat
34
artifacts
45
coverage.json
56

contracts/README.md

+54-14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
88

99
### v2-prealpha-3
1010

11+
#### Chiado
12+
13+
- [ArbitrableExample](https://blockscout.com/gnosis/chiado/address/0xc0fcc96BFd78e36550FCaB434A9EE1210B57225b)
14+
- [ForeignGatewayOnGnosis](https://blockscout.com/gnosis/chiado/address/0x87142b7E9C7D026776499120D902AF8896C07894)
15+
- [SortitionSumTreeFactory](https://blockscout.com/gnosis/chiado/address/0xc7e3BF90299f6BD9FA7c3703837A9CAbB5743636)
16+
- [TokenBridge](https://blockscout.com/gnosis/chiado/address/0xbb3c86f9918C3C1d83668fA84e79E876d147fFf2)
17+
- [WETH](https://blockscout.com/gnosis/chiado/address/0x014A442480DbAD767b7615E55E271799889FA1a7)
18+
- [WETHFaucet](https://blockscout.com/gnosis/chiado/address/0x395014fddc3b12F9a78ED8E57DA162Fd77E12bE3)
19+
- [WPNKFaucet](https://blockscout.com/gnosis/chiado/address/0x5898aeE045A25B276369914c3448B72a41758B2c)
20+
- [WrappedPinakionV2](https://blockscout.com/gnosis/chiado/address/0xD75E27A56AaF9eE7F8d9A472a8C2EF2f65a764dd)
21+
- [xKlerosLiquidV2](https://blockscout.com/gnosis/chiado/address/0x34E520dc1d2Db660113b64724e14CEdCD01Ee879)
22+
1123
#### Goerli
1224

1325
- [PNK](https://goerli.etherscan.io/token/0xA3B02bA6E10F55fb177637917B1b472da0110CcC)
@@ -19,14 +31,15 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
1931

2032
- [PNK](https://goerli.arbiscan.io/token/0x4DEeeFD054434bf6721eF39Aa18EfB3fd0D12610/token-transfers)
2133
- [BlockHashRNG](https://goerli.arbiscan.io/address/0x68eE49dfD9d76f3386257a3D0e0A85c0A5519bBD)
22-
- [DisputeKitClassic](https://goerli.arbiscan.io/address/0xde31F2245d164620d08f5b0f8D43dCe8B9708373)
23-
- [DisputeResolver](https://goerli.arbiscan.io/address/0xa1f52474CFa1ee78758a4bBa35DE547133Bda62f)
34+
- [DisputeKitClassic](https://goerli.arbiscan.io/address/0x86734488ABF0E1AD40bc4DE4F820e808f39Bea09)
35+
- [DisputeResolver](https://goerli.arbiscan.io/address/0xDe3eCeB73C453E56F5661ad029a41341CF592b9A)
2436
- [FastBridgeSender](https://goerli.arbiscan.io/address/0x4d18b9792e0D8F5aF696E71dBEDff8fcBEed6e8C)
2537
- [HomeGatewayToEthereum](https://goerli.arbiscan.io/address/0xed12799915180a257985631fbD2ead261eD838cf)
26-
- [KlerosCore](https://goerli.arbiscan.io/address/0x4d7858e73a8842b5e6422D08a3349924dD062AbB)
27-
- [PolicyRegistry](https://goerli.arbiscan.io/address/0xAF0F49Fe110b48bd512F00d51D141F023c9a9106)
28-
- [RandomizerRNG](https://goerli.arbiscan.io/address/0xb82D1eAD813C3a2E729F288276cc402343423Bad)
29-
- [SortitionSumTreeFactory](https://goerli.arbiscan.io/address/0x40a78989317B953e427B3BD87C59eA003fcC2296)
38+
- [HomeGatewayToGnosis](https://goerli.arbiscan.io/address/0x12613A66F1E5A2086374e103F66BF0eddA5d1478)
39+
- [KlerosCore](https://goerli.arbiscan.io/address/0x3eED6aaCa43f4Bb98C591e4A0d2C4a124efF9C24)
40+
- [PolicyRegistry](https://goerli.arbiscan.io/address/0xC5655728387Ce5E2aAA22138114E5777370aBDae)
41+
- [RandomizerRNG](https://goerli.arbiscan.io/address/0xa2d1A3CDF0becEdb724e5A34De7022B6FF5e4787)
42+
- [SortitionSumTreeFactoryV2](https://goerli.arbiscan.io/address/0x678E676fd0048da8c35d5B03fabB53a7beBf73A6)
3043

3144
## Getting Started
3245

@@ -82,6 +95,7 @@ The ones below are optional:
8295

8396
- `ETHERSCAN_API_KEY`: to verify the source of the newly deployed contracts on **Etherscan**.
8497
- `ARBISCAN_API_KEY`: to verify the source of the newly deployed contracts on **Arbitrum**.
98+
- `GNOSISSCAN_API_KEY`: to verify the source of the newly deployed contracts on **Gnosis chain**.
8599

86100
#### 1. Update the Constructor Parameters (optional)
87101

@@ -100,20 +114,25 @@ yarn hardhat node --tags nothing
100114
**Shell 2: the deploy script**
101115

102116
```bash
103-
yarn deploy --network localhost --tags <Arbitration|VeaMock>
117+
yarn deploy --network localhost --tags <Arbitration|VeaMock|ForeignGatewayOnEthereum|HomeGateway>
104118
```
105119

106120
#### 3. Deploy to Public Testnets
107121

108122
```bash
123+
# ArbitrumGoerli to Chiado
124+
yarn deploy --network arbitrumGoerli --tags Arbitration
125+
yarn deploy --network chiado --tags ForeignGatewayOnGnosis
126+
yarn deploy --network chiado --tags KlerosLiquidOnGnosis
127+
yarn deploy --network arbitrumGoerli --tags HomeGatewayToGnosis
128+
109129
# Goerli
110130
yarn deploy --network arbitrumGoerli --tags Arbitration
111-
yarn deploy --network goerli --tags ForeignGateway
112-
yarn deploy --network arbitrumGoerli --tags HomeGateway
131+
yarn deploy --network goerli --tags ForeignGatewayOnEthereum
132+
yarn deploy --network arbitrumGoerli --tags HomeGatewayToEthereum
113133
```
114134

115-
The deployed addresses should be output to the screen after the deployment is complete.
116-
If you miss that, you can always go to the `deployments/<network>` directory and look for the respective file.
135+
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.
117136

118137
#### Running Test Fixtures
119138

@@ -134,7 +153,7 @@ yarn test --network localhost
134153
This must be done for each network separately.
135154

136155
```bash
137-
yarn etherscan-verify --network <arbitrumGoerli|arbitrumRinkeby|arbitrum|goerli|rinkeby|mainnet>
156+
yarn etherscan-verify --network <arbitrumGoerli|arbitrum|chiado|gnosischain|goerli|mainnet>
138157
```
139158

140159
## Ad-hoc procedures
@@ -144,12 +163,19 @@ yarn etherscan-verify --network <arbitrumGoerli|arbitrumRinkeby|arbitrum|goerli|
144163
#### 1/ Export the registry data from V1
145164

146165
```bash
147-
yarn hardhat run scripts/getPoliciesV1.ts --network mainnet | tee policies.v1.json
148-
yarn hardhat run scripts/getCourtsV1.ts --network mainnet | tee courts.v1.json
166+
for network in mainnet gnosischain
167+
do
168+
yarn hardhat run scripts/getPoliciesV1.ts --network $network | tee config/policies.v1.$network.json
169+
yarn hardhat run scripts/getCourtsV1.ts --network $network | tee config/courts.v1.$network.json
170+
done
149171
```
150172

151173
#### 2/ Import the data to V2 - Local Network
152174

175+
:warning: By default this script populates from `*.mainnet.json`. To populate from `*.gnosischain.json`, set the variable `USE_GNOSIS` to true inside [scripts/populateCourts.ts](scripts/populateCourts.ts).
176+
177+
:warning: It is possible to switch to testnet-friendly court parameters by setting the variable `TESTING_PARAMETERS` to true inside [scripts/populateCourts.ts](scripts/populateCourts.ts).
178+
153179
Shell 1:
154180

155181
```bash
@@ -170,6 +196,20 @@ yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumGoerli
170196
yarn hardhat run scripts/populateCourts.ts --network arbitrumGoerli
171197
```
172198

199+
### Generate deployment artifacts for existing contracts
200+
201+
#### Usage
202+
203+
```bash
204+
scripts/generateDeploymentArtifact.sh <network> <address>
205+
```
206+
207+
#### Example: WETH on Gnosis chain
208+
209+
```bash
210+
scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f3cfda759a9d9 > deployments/gnosischain/WETH.json
211+
```
212+
173213
### Push the contracts to a Tenderly project
174214

175215
Ensure that your `$TENDERLY_PROJECT` and `$TENDERLY_USERNAME` is set correctly in `.env`.

0 commit comments

Comments
 (0)