Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release of v2-testnet-3.0.3 #1422

Merged
merged 105 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
66521f2
feat(wip/web): add commit reveal support
alcercu Aug 18, 2023
bd8b1fd
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Oct 12, 2023
f350a41
refactor(web): abstract isDesktop
alcercu Oct 12, 2023
5f34eb2
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Oct 30, 2023
59d73de
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Oct 30, 2023
8d4931a
feat(web): add commit reveal
alcercu Oct 30, 2023
3832028
fix: privateKeyToAccount correct args
alcercu Dec 5, 2023
6e36ecb
refactor(web): improve refuseToArbitrateContainer style so it can be …
alcercu Dec 5, 2023
7728c88
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Dec 5, 2023
84e9f0e
refactor(web): check if appealCost is undefined at isLastRound level
alcercu Dec 29, 2023
983690f
fix(web): hash signature to ensure private key is 256 bits long
alcercu Dec 29, 2023
efd5875
fix(web): hash signature output to make sure salt is 256 bits long
alcercu Dec 29, 2023
49b9763
feat(web): brute force vote choice from salt
alcercu Dec 29, 2023
b986270
fix(web): pass new arguments to Reveal component
alcercu Dec 29, 2023
e421d82
fix(web): logic for showing the commit and voting screen
alcercu Dec 29, 2023
2c9fca6
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Dec 29, 2023
c9bcbaa
fix(web): make sure that the user didn't cancel salt generation
alcercu Dec 29, 2023
9f8043f
Merge branch 'dev' into feat(web)/commit-reveal
alcercu Jan 8, 2024
2b9960a
fix(web): correct salt typing for commit
alcercu Jan 8, 2024
b771819
feat(contracts): escrow-v2-general-escrow-event-update
kemuru Jan 8, 2024
1b5a16a
chore: viem experiment
jaybuidl Jan 9, 2024
a58d60e
fix(web): show nothing under Execution period
alcercu Jan 9, 2024
a530205
refactor(web): abstract InfoCard
alcercu Jan 9, 2024
d1fcd9a
fix(web): show correct popup when revealign
alcercu Jan 9, 2024
5d2d039
fix(web): don't show popup if the user cancels the tx
alcercu Jan 9, 2024
88aa8cf
feat(web): show info messages when not in reveal period or when faile…
alcercu Jan 9, 2024
8184b87
chore: enabling hidden votes in the devnet court, script tweaks
jaybuidl Jan 9, 2024
553e4e5
Merge branch 'dev' into feat(contracts)/escrow-v2-general-escrow-even…
kemuru Jan 9, 2024
251cf94
Merge branch 'dev' into feat(web)/commit-reveal
kemuru Jan 9, 2024
15bd229
feat(web): add asset to event parameter and emit
kemuru Jan 10, 2024
5565d55
Merge branch 'feat(contracts)/escrow-v2-general-escrow-event-update' …
kemuru Jan 10, 2024
5d111f4
fix(web): update chainId on eip712 messages
alcercu Jan 10, 2024
663f14f
fix(web): refetch draw query after commiting a vote
alcercu Jan 10, 2024
e64ea3d
fix(web): times up indicator on execution phase
alcercu Jan 10, 2024
d803d98
feat(contracts): update natspec escrow contract
kemuru Jan 10, 2024
c4debb9
chore: new Escrow contract deployment
jaybuidl Jan 10, 2024
0fc9bcc
feat(web): basic-dispute-resolver-ui
Harman-singh-waraich Dec 29, 2023
f457622
feat(web): add-dispute-data-collection-and-basic-dispute-creation
Harman-singh-waraich Jan 2, 2024
e0f9f04
feat(web): add-success-popup-on-dispute-creation-and-update-wrapWithT…
Harman-singh-waraich Jan 2, 2024
ddeb92c
fix(web): remove-dispute-data-from-localstorage-on-reset
Harman-singh-waraich Jan 2, 2024
33e3c00
fix(web): fixed-value-not-persisting-in-some-fields-in-resolver
Harman-singh-waraich Jan 3, 2024
52d0037
refactor(web): better-dispute-template-construction
Harman-singh-waraich Jan 3, 2024
2d6c702
fix(web): disable-submitCase-button-while-sending-txn
Harman-singh-waraich Jan 3, 2024
63c87dd
fix(web): fix-policy-uri-not-being-passed-in-props
Harman-singh-waraich Jan 3, 2024
f96dfdb
feat(web): handle-policy-upload
Harman-singh-waraich Jan 3, 2024
6b95e0c
refactor(web): better-enable-condition-for-dispute-submittion-prepare…
Harman-singh-waraich Jan 4, 2024
4014b05
fix(web): fix-courtId-prop-was-hardcoded-in-Preview-policy
Harman-singh-waraich Jan 4, 2024
269d772
feat(web): add-alias-handling-and-UI
Harman-singh-waraich Jan 4, 2024
22c21e6
feat(web): add-multiple-voting-options-support
Harman-singh-waraich Jan 4, 2024
3279eaa
refactor(web): fix-code-smells
Harman-singh-waraich Jan 5, 2024
dbe0c9c
refactor(web): fix-unique-id-as-key-instead-of-array-index
Harman-singh-waraich Jan 5, 2024
43f2887
refactor(web): better-decoding-logic-to-retrieve-dispute-id
Harman-singh-waraich Jan 8, 2024
3c6d76a
refactor(web): add-network-check-and-loading-ui-to-submit-case-button
Harman-singh-waraich Jan 8, 2024
327a6d5
refactor(web): disable-next-button-when-arbitration-cost-loading
Harman-singh-waraich Jan 8, 2024
2ccc6d7
refactor(web): use-uselocalstorage-hook-to-handle-dispute-data-persist
Harman-singh-waraich Jan 8, 2024
8b2cd78
refactor(web): remove-data-mappings-todo-from-submit-dispute-call
Harman-singh-waraich Jan 8, 2024
5ebbcd6
refactor(web): move-resolver-access-to-kleros-solution-list
Harman-singh-waraich Jan 8, 2024
961545c
fix(web): fix-typo
Harman-singh-waraich Jan 8, 2024
71cf0e3
feat(web): add-description-field-in-resolver-forms
Harman-singh-waraich Jan 9, 2024
8e8b6e1
feat(web): option-description-display-in-dispute-context
Harman-singh-waraich Jan 9, 2024
78600b0
feat(web): add-cta-for-dispute-resolver
Harman-singh-waraich Jan 9, 2024
dc7c187
refactor(web): update-voting-options-and-counterparties-layout
Harman-singh-waraich Jan 9, 2024
71f4afa
fix(web): disable-next-button-while-policy-uploading
Harman-singh-waraich Jan 9, 2024
54f64e5
fix(web): remove-default-court-id-let-user-select-explicitly
Harman-singh-waraich Jan 9, 2024
6993b98
feat(web): add-dispute-resolvation-estimate-date
Harman-singh-waraich Jan 9, 2024
7bf1ac9
refactor(web): update-wrap-with-toast-function
Harman-singh-waraich Jan 10, 2024
51806c6
refactor(web): update-policy-upload-placeholder
Harman-singh-waraich Jan 10, 2024
1fb2b05
refactor(web): addressing-sonar-check-issue
Harman-singh-waraich Jan 10, 2024
f0e01ec
fix: linter
jaybuidl Jan 10, 2024
0165b1d
Merge branch 'dev' into feat(web)/commit-reveal
jaybuidl Jan 10, 2024
0599b21
refactor(web): rename-counterparties-to-notable-persons
Harman-singh-waraich Jan 11, 2024
cad29fd
feat(web): add-address-validation
Harman-singh-waraich Jan 11, 2024
27a6b87
refactor(web): break-down-notable-persons-component
Harman-singh-waraich Jan 11, 2024
96571a1
fix(web): check-if-alias-field-exists
Harman-singh-waraich Jan 11, 2024
223abb9
fix(web): fix-cognitive-complexity-issue
Harman-singh-waraich Jan 11, 2024
b2524ca
fix(web): add-check-in-arbitration-cost-fetch
Harman-singh-waraich Jan 11, 2024
e7d0126
fix(web): second-attempt-at-fixing-cognitive-complexity
Harman-singh-waraich Jan 11, 2024
9866102
refactor(web): remove-unused-import
Harman-singh-waraich Jan 11, 2024
5b5b233
fix(web): fix-cases-list-view-alignment
Harman-singh-waraich Jan 12, 2024
d562f21
fix(web): fix-filter-stats-not-showing-correct-in-progress-cases
Harman-singh-waraich Jan 12, 2024
3e17477
fix(web): add-skeleton-when-drawn-data-loading
Harman-singh-waraich Jan 12, 2024
32e7ab4
fix(web): evidence-skeleton-overflowing
Harman-singh-waraich Jan 12, 2024
a48449f
refactor(web): remove-nested-operator
Harman-singh-waraich Jan 12, 2024
7d52c27
fix(web): appeal-tab-not-becoming-active-on-its-own
Harman-singh-waraich Jan 15, 2024
8653384
feat(web): add-last-funded-choice-info-label
Harman-singh-waraich Jan 15, 2024
3627dd3
fix(web): fund-input-not-selectable-in-stage-two-appeal
Harman-singh-waraich Jan 16, 2024
95f2f0a
fix(web): disable-fund-button-on-error-and-zero-input
Harman-singh-waraich Jan 16, 2024
2f738e8
fix(web): fix-popup-opening-on-user-reject
Harman-singh-waraich Jan 16, 2024
9e9a9ee
fix(web): fix-fully-funded-option-still-selectable
Harman-singh-waraich Jan 16, 2024
dd58dbb
feat(web): add-stage-explaner-for-stage-2-appeal
Harman-singh-waraich Jan 16, 2024
a536cec
Merge pull request #1408 from kleros/fix(web)/evidence-skeleton-overf…
alcercu Jan 16, 2024
a2d5653
Merge pull request #1407 from kleros/fix(web)/incorrect-progress-disp…
alcercu Jan 16, 2024
239869d
Merge pull request #1406 from kleros/fix(web)/fix-cases-list-view-ali…
alcercu Jan 16, 2024
3399141
chore: testnet court periods to 12h
jaybuidl Jan 13, 2024
7d866c7
chore: minor
jaybuidl Jan 17, 2024
6da3089
refactor(web): add-loading-indicator-in-stage-two-appeal-display
Harman-singh-waraich Jan 17, 2024
dea63d5
refactor(web): fix-code-smells
Harman-singh-waraich Jan 17, 2024
f0c5d3f
refactor(web): center-connect-button-in-fund-input
Harman-singh-waraich Jan 17, 2024
e3e7d5c
fix(web): incorrect-locked-pnk-display-in-dashboard
Harman-singh-waraich Jan 17, 2024
aaa07c5
refactor(web): display-locked-PNK-upto-2-decimals
Harman-singh-waraich Jan 17, 2024
a8b9dc5
refactor(web): update-stage-2-explanation
Harman-singh-waraich Jan 17, 2024
a6beea5
Merge branch 'dev' into fix(web)--appeal-tab-issues
alcercu Jan 18, 2024
0da521f
Merge pull request #1420 from kleros/fix(web)--appeal-tab-issues
alcercu Jan 18, 2024
d9a61c2
fix(subgraph): incorrect totalVoted on ClassicRound
alcercu Jan 10, 2024
a1f859e
Merge branch 'master' into dev
jaybuidl Jan 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion contracts/.env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
REPORT_GAS=true

INFURA_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1

# Testing
REPORT_GAS=true

# There seems to be a bug with hardhat-deploy's implementation of etherscan-verify
# If ETHERSCAN_API_KEY is set, it overrides any hardhat configuration.
ETHERSCAN_API_KEY_FIX=ABC123ABC123ABC123ABC123ABC123ABC1
ARBISCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
GNOSISSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1

# For the bots
LOG_LEVEL=debug
SUBGRAPH_URL=https://api.studio.thegraph.com/query/61738/kleros-v2-core-devnet/version/latest
LOGTAIL_TOKEN_KEEPER_BOT=cqPqBofVC8nmA8EZdZGqqvUV
LOGTAIL_TOKEN_RELAYER_BOT=41h8q5Z4gnz5yDx215eqcQ4r
LOGTAIL_TOKEN_DISPUTOR_BOT=mSryyvYubviaMqKDWfBKAGsi
HEARTBEAT_URL_KEEPER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/jc23S8ZZzpf8KbzwxL1hoBp9
HEARTBEAT_URL_RELAYER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/eT6Trk6CddJV6fFBbqZNzyqC
DISPUTES_TO_SKIP=

# Optionally for debugging
# TENDERLY_USERNAME=your_username
# TENDERLY_PROJECT=your_project
Expand Down
5 changes: 5 additions & 0 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# NOP, just force npm to disregard .gitignore
# https://docs.npmjs.com/cli/v9/using-npm/developers#keeping-files-out-of-your-package

.env*
.flaskenv*
!.env.project
!.env.vault
10 changes: 4 additions & 6 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Smart contracts for Kleros v2

## Deployments

Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh`.
Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh` or `./scripts/populateReadme.sh`.

### Official Testnet

Expand Down Expand Up @@ -57,7 +57,7 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8)
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xB8B36CC43f852f9F0484f53Eb38CaBBA28a81bF6)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xc53b813ed94AaEb6F5518D60bf6a8109954bE3f6)
- [Escrow](https://sepolia.arbiscan.io/address/0xdaf749DABE7be6C6894950AE69af35c20a00ABd9)
- [Escrow](https://sepolia.arbiscan.io/address/0x10f7A6f42Af606553883415bc8862643A6e63fdA)
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x57fd453FB0d16f8ca174E7386102D7170E17Be09), [implementation](https://sepolia.arbiscan.io/address/0x05AD81f245209b7f91885fd96e57c9da90554824)
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085)
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)
Expand Down Expand Up @@ -214,6 +214,8 @@ yarn sourcify --network <arbitrumSepolia|arbitrum|chiado|gnosischain|sepolia|mai

### Populating the policy registry and courts

The policy registry and courts configuration can be found in `config/policies.*.json` and `config/courts.*.json`.

#### 1/ Export the registry data from V1

```bash
Expand All @@ -226,10 +228,6 @@ done

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

: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).

: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).

Shell 1:

```bash
Expand Down
197 changes: 197 additions & 0 deletions contracts/README.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
# @kleros/kleros-v2-contracts

Smart contracts for Kleros v2

## Deployments

Refresh the list of deployed contracts by running `./scripts/generateDeploymentsMarkdown.sh` or `./scripts/populateReadme.sh`.

$deployments

## Getting Started

### Install the Dependencies

```bash
yarn install
```

### Run Tests

```bash
yarn test
```

### Compile the Contracts

```bash
yarn build
```

### Run Linter on Files

```bash
yarn lint
```

### Fix Linter Issues on Files

```bash
yarn fix
```

### Deploy Instructions

**NOTICE:** the commands below work only if you are inside the `contracts/` directory.

#### 0. Set the Environment Variables

Copy `.env.example` file as `.env` and edit it accordingly.

```bash
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**.

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

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

#### 2. Deploy to a Local Network

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**

```bash
yarn hardhat node --tags nothing
```

**Shell 2: the deploy script**

```bash
yarn deploy --network localhost --tags <Arbitration|VeaMock|ForeignGatewayOnEthereum|HomeGateway>
```

#### 3. Deploy to Public Testnets

```bash
# ArbitrumSepolia to Chiado
yarn deploy --network arbitrumSepolia --tags Arbitration
yarn deploy --network arbitrumSepolia --tags HomeArbitrable
yarn deploy --network chiado --tags ForeignGatewayOnGnosis
yarn deploy --network chiado --tags KlerosLiquidOnGnosis
yarn deploy --network chiado --tags ForeignArbitrable
yarn deploy --network arbitrumSepolia --tags HomeGatewayToGnosis

# Sepolia
yarn deploy --network sepolia --tags ForeignGatewayOnEthereum
yarn deploy --network sepolia --tags ForeignArbitrable
yarn deploy --network arbitrumSepolia --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.

#### 4. Deploy a Devnet on Public Testnets

Same steps as above but append `Devnet` to the `--network` parameter.

#### Running Test Fixtures

**Shell 1: the node**

```bash
yarn hardhat node --tags Arbitration,VeaMock
```

**Shell 2: the test scripts**

```bash
yarn test --network localhost
```

#### 4. Verify the Source Code

This must be done for each network separately.

```bash
# explorer
yarn etherscan-verify --network <arbitrumSepolia|arbitrum|chiado|gnosischain|sepolia|mainnet>
yarn etherscan-verify-proxies

# sourcify
yarn sourcify --network <arbitrumSepolia|arbitrum|chiado|gnosischain|sepolia|mainnet>

```

## Ad-hoc procedures

### Populating the policy registry and courts

The policy registry and courts configuration can be found in `config/policies.*.json` and `config/courts.*.json`.

#### 1/ Export the registry data from V1

```bash
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
```

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

Shell 1:

```bash
yarn hardhat node --tags Arbitration
```

Shell 2:

```bash
yarn hardhat run scripts/populateCourts.ts --network localhost
yarn hardhat run scripts/populatePolicyRegistry.ts --network localhost
```

#### 3/ Import the data to V2 - Public Testnet

```bash
yarn hardhat run scripts/populateCourts.ts --network arbitrumSepolia
yarn hardhat run scripts/populatePolicyRegistry.ts --network arbitrumSepolia
```

### Generate deployment artifacts for existing contracts

#### Usage

```bash
scripts/generateDeploymentArtifact.sh <network> <address>
```

#### Example: WETH on Gnosis chain

```bash
scripts/generateDeploymentArtifact.sh gnosischain 0xf8d1677c8a0c961938bf2f9adc3f3cfda759a9d9 > deployments/gnosischain/WETH.json
```

### Push the contracts to a Tenderly project

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

```bash
yarn tenderly-verify --network sepolia
yarn tenderly-verify --network arbitrumSepolia
```
Loading