Skip to content

Commit b33651a

Browse files
committed
Merge branch 'dev' into feat/atlas-spam-api
2 parents e833a83 + f3f05ab commit b33651a

File tree

97 files changed

+2335
-2136
lines changed

Some content is hidden

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

97 files changed

+2335
-2136
lines changed

.github/workflows/contracts-testing.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Harden Runner
27-
uses: step-security/[email protected]
27+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
2828
with:
2929
disable-sudo: true
3030
egress-policy: block
@@ -38,16 +38,23 @@ jobs:
3838
registry.yarnpkg.com:443
3939
registry.npmjs.org:443
4040
54.185.253.63:443
41-
42-
- name: Setup Node.js environment
43-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
44-
with:
45-
node-version: 18.x
4641
4742
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4843
with:
4944
submodules: recursive
50-
45+
46+
- name: Set up corepack (for yarn)
47+
run: |
48+
corepack enable
49+
corepack prepare [email protected] --activate
50+
yarn set version 4.5.1
51+
52+
- name: Setup Node.js environment
53+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
54+
with:
55+
node-version: 20.x
56+
cache: yarn
57+
5158
- name: Cache node modules
5259
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5360
env:

.github/workflows/pr-labels.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/sentry-release.yml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,62 @@ jobs:
1717
version: ${{ steps.set-version.outputs.version }}
1818
steps:
1919
- name: Harden Runner
20-
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.5.0
20+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
2121
with:
2222
disable-sudo: true
2323
egress-policy: block
2424
allowed-endpoints: >
2525
binaries.soliditylang.org:443
26+
classic.yarnpkg.com:443
2627
github.com:443
28+
nightly.yarnpkg.com:443
2729
nodejs.org:443
30+
objects.githubusercontent.com:443
2831
registry.yarnpkg.com:443
29-
sentry.io:443
32+
registry.npmjs.org:443
3033
54.185.253.63:443
34+
sentry.io:443
3135
32-
- uses: actions/checkout@7739b9ba2efcda9dde65ad1e3c2dbe65b41dfba7
33-
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
with:
38+
submodules: recursive
39+
40+
- name: Set up corepack (for yarn)
41+
run: |
42+
corepack enable
43+
corepack prepare [email protected] --activate
44+
yarn set version 4.5.1
45+
46+
- name: Setup Node.js environment
47+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
48+
with:
49+
node-version: 20.x
50+
cache: yarn
51+
3452
- name: Cache node modules
35-
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
53+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
3654
env:
3755
cache-name: cache-node-modules
3856
with:
3957
path: |
4058
~/.npm
4159
**/node_modules
42-
key: |
43-
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
60+
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
4461
restore-keys: |
4562
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
46-
47-
- name: Set up Node.js
48-
uses: actions/setup-node@2a017f350dbf6c4b6bb4508cc83809719115162e
49-
with:
50-
node-version: 16
51-
52-
- name: Install dependencies
53-
run: |
54-
yarn workspace @kleros/kleros-v2-contracts install
55-
yarn workspace @kleros/kleros-v2-web install
5663
57-
- name: Build
64+
- name: Install dependencies and build
5865
run: |
59-
yarn workspace @kleros/kleros-v2-contracts build
60-
yarn workspace @kleros/kleros-v2-web build
66+
. web/.env.mainnet-neo.public
67+
yarn build:web:ci
6168
6269
- name: Set version
6370
id: set-version
6471
run: echo "version=v$(cat package.json | jq -r .version)-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
6572
working-directory: web
6673

6774
- name: Create Sentry release
68-
uses: getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7 # v1.4.1
75+
uses: getsentry/action-release@v1
6976
env:
7077
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
7178
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}

contracts/deploy/00-home-chain-arbitration-neo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
7373
deployer,
7474
deployer,
7575
pnk.target,
76-
ZeroAddress, // KlerosCore is configured later
76+
ZeroAddress, // jurorProsecutionModule is not implemented yet
7777
disputeKit.address,
7878
false,
7979
[minStake, alpha, feeForJuror, jurorsForCourtJump],
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { HardhatRuntimeEnvironment } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
3+
import { deployUpgradable } from "./utils/deployUpgradable";
4+
import { HomeChains, isSkipped } from "./utils";
5+
6+
const deployUpgradeDisputeKit: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
7+
const { deployments, getNamedAccounts, getChainId } = hre;
8+
9+
// fallback to hardhat node signers on local network
10+
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
11+
const chainId = Number(await getChainId());
12+
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
13+
14+
try {
15+
console.log("upgrading DisputeKitClassicNeo...");
16+
await deployUpgradable(deployments, "DisputeKitClassicNeo", {
17+
contract: "DisputeKitClassic",
18+
initializer: "initialize",
19+
from: deployer,
20+
// Warning: do not reinitialize everything, only the new variables
21+
args: [],
22+
});
23+
} catch (err) {
24+
console.error(err);
25+
throw err;
26+
}
27+
};
28+
29+
deployUpgradeDisputeKit.tags = ["Upgrade", "DisputeKit"];
30+
deployUpgradeDisputeKit.skip = async ({ network }) => {
31+
return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
32+
};
33+
34+
export default deployUpgradeDisputeKit;

contracts/deploy/upgrade-kleros-core.ts

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,21 @@ import { deployUpgradable } from "./utils/deployUpgradable";
44
import { HomeChains, isSkipped } from "./utils";
55

66
const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
7-
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
8-
const { ZeroAddress } = hre.ethers;
7+
const { deployments, getNamedAccounts, getChainId } = hre;
98

109
// fallback to hardhat node signers on local network
1110
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
1211
const chainId = Number(await getChainId());
13-
console.log("upgrading to %s with deployer %s", HomeChains[chainId], deployer);
12+
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
1413

1514
try {
16-
const pnk = await deployments.get("PNK");
17-
const disputeKit = await deployments.get("DisputeKitClassic");
18-
const minStake = 2n * 10n ** 20n;
19-
const alpha = 10000;
20-
const feeForJuror = 10n * 17n;
21-
const sortitionModule = await deployments.get("SortitionModule");
22-
23-
console.log("upgrading the KlerosCore...");
24-
await deployUpgradable(deployments, "KlerosCore", {
15+
console.log("upgrading KlerosCoreNeo...");
16+
await deployUpgradable(deployments, "KlerosCoreNeo", {
17+
newImplementation: "KlerosCoreNeo",
18+
initializer: "initialize",
2519
from: deployer,
26-
args: [
27-
deployer,
28-
pnk,
29-
ZeroAddress,
30-
disputeKit.address,
31-
false,
32-
[minStake, alpha, feeForJuror, 256], // minStake, alpha, feeForJuror, jurorsForCourtJump
33-
[0, 0, 0, 10], // evidencePeriod, commitPeriod, votePeriod, appealPeriod
34-
ethers.toBeHex(5), // Extra data for sortition module will return the default value of K
35-
sortitionModule.address,
36-
],
20+
// Warning: do not reinitialize everything, only the new variables
21+
args: [],
3722
});
3823
} catch (err) {
3924
console.error(err);

contracts/deploy/upgrade-sortition-module.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,20 @@ import { HomeChains, isSkipped } from "./utils";
55

66
const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
77
const { deployments, getNamedAccounts, getChainId } = hre;
8-
const RNG_LOOKAHEAD = 20;
98

109
// fallback to hardhat node signers on local network
1110
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
1211
const chainId = Number(await getChainId());
13-
console.log("upgrading to %s with deployer %s", HomeChains[chainId], deployer);
12+
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
1413

1514
try {
16-
const rng = await deployments.get("RandomizerRNG");
17-
const klerosCore = await deployments.get("KlerosCore");
18-
const klerosCoreAddress = klerosCore.address;
19-
20-
console.log("upgrading the SortitionModule...");
21-
await deployUpgradable(deployments, "SortitionModule", {
15+
console.log("upgrading SortitionModuleNeo...");
16+
await deployUpgradable(deployments, "SortitionModuleNeo", {
17+
newImplementation: "SortitionModuleNeo",
18+
initializer: "initialize",
2219
from: deployer,
23-
args: [
24-
deployer,
25-
klerosCoreAddress,
26-
1800, // minStakingTime
27-
1800, // maxFreezingTime
28-
rng.address,
29-
RNG_LOOKAHEAD,
30-
],
20+
// Warning: do not reinitialize everything, only the new variables
21+
args: [],
3122
});
3223
} catch (err) {
3324
console.error(err);

contracts/hardhat.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const config: HardhatUserConfig = {
9595
// Home chain ---------------------------------------------------------------------------------
9696
arbitrumSepolia: {
9797
chainId: 421614,
98-
url: process.env.ARBITRUM_SEPOLIA_RPC ?? "https://sepolia-rollup.arbitrum.io/rpc",
98+
url: process.env.ARBITRUM_SEPOLIA_RPC ?? `https://arbitrum-sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
9999
accounts:
100100
(process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [
101101
process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string,
@@ -121,7 +121,7 @@ const config: HardhatUserConfig = {
121121
},
122122
arbitrumSepoliaDevnet: {
123123
chainId: 421614,
124-
url: process.env.ARBITRUM_SEPOLIA_RPC ?? "https://sepolia-rollup.arbitrum.io/rpc",
124+
url: process.env.ARBITRUM_SEPOLIA_RPC ?? `https://arbitrum-sepolia.infura.io/v3/${process.env.INFURA_API_KEY}`,
125125
accounts:
126126
(process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 && [
127127
process.env.ARB_GOERLI_PRIVATE_KEY_WALLET_1 as string,
@@ -147,7 +147,7 @@ const config: HardhatUserConfig = {
147147
},
148148
arbitrum: {
149149
chainId: 42161,
150-
url: "https://arb1.arbitrum.io/rpc",
150+
url: process.env.ARBITRUM_RPC ?? `https://arbitrum-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`,
151151
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
152152
live: true,
153153
saveDeployments: true,

contracts/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"start-local": "hardhat node --tags Arbitration,HomeArbitrable --hostname 0.0.0.0",
2828
"deploy": "hardhat deploy",
2929
"deploy-local": "hardhat deploy --tags Arbitration,HomeArbitrable --network localhost",
30+
"validate-upgrades": "openzeppelin-upgrades-core validate --exclude 'src/proxy/mock/**/*.sol' --exclude 'src/test/**/*.sol' artifacts/build-info",
3031
"simulate": "hardhat simulate:all",
3132
"simulate-local": "hardhat simulate:all --network localhost",
3233
"viem:generate-devnet": "NODE_NO_WARNINGS=1 wagmi generate -c wagmi.config.devnet.ts",
@@ -69,6 +70,7 @@
6970
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
7071
"@nomicfoundation/hardhat-ethers": "^3.0.8",
7172
"@nomiclabs/hardhat-solhint": "^4.0.1",
73+
"@openzeppelin/upgrades-core": "^1.41.0",
7274
"@typechain/ethers-v6": "^0.5.1",
7375
"@typechain/hardhat": "^9.1.0",
7476
"@types/chai": "^4.3.20",
@@ -80,23 +82,23 @@
8082
"dotenv": "^16.4.5",
8183
"eslint": "^9.15.0",
8284
"ethereumjs-util": "^7.1.5",
83-
"ethers": "^6.13.4",
85+
"ethers": "^6.13.5",
8486
"graphql": "^16.9.0",
8587
"graphql-request": "^7.1.2",
86-
"hardhat": "2.22.16",
88+
"hardhat": "2.22.18",
8789
"hardhat-contract-sizer": "^2.10.0",
8890
"hardhat-deploy": "^0.14.0",
8991
"hardhat-deploy-ethers": "^0.4.2",
90-
"hardhat-deploy-tenderly": "^0.2.0",
92+
"hardhat-deploy-tenderly": "^0.2.1",
9193
"hardhat-docgen": "^1.3.0",
92-
"hardhat-gas-reporter": "^2.2.1",
94+
"hardhat-gas-reporter": "^2.2.2",
9395
"hardhat-tracer": "^3.1.0",
9496
"hardhat-watcher": "^2.5.0",
9597
"node-fetch": "^3.3.2",
9698
"pino": "^8.21.0",
9799
"pino-pretty": "^10.3.1",
98100
"prettier": "^3.3.3",
99-
"prettier-plugin-solidity": "^1.4.1",
101+
"prettier-plugin-solidity": "^1.4.2",
100102
"shelljs": "^0.8.5",
101103
"solhint-plugin-prettier": "^0.1.0",
102104
"solidity-coverage": "^0.8.13",
@@ -107,7 +109,7 @@
107109
"dependencies": {
108110
"@chainlink/contracts": "^1.3.0",
109111
"@kleros/vea-contracts": "^0.4.0",
110-
"@openzeppelin/contracts": "^5.1.0",
112+
"@openzeppelin/contracts": "^5.2.0",
111113
"viem": "^2.21.48"
112114
}
113115
}

contracts/src/arbitration/DisputeTemplateRegistry.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import "./interfaces/IDisputeTemplateRegistry.sol";
88
/// @title Dispute Template Registry
99
/// @dev A contract to maintain a registry of dispute templates.
1010
contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Initializable {
11+
string public constant override version = "0.8.0";
12+
1113
// ************************************* //
1214
// * Storage * //
1315
// ************************************* //
@@ -31,7 +33,7 @@ contract DisputeTemplateRegistry is IDisputeTemplateRegistry, UUPSProxiable, Ini
3133
// * Constructor * //
3234
// ************************************* //
3335

34-
/// @dev Constructor, initializing the implementation to reduce attack surface.
36+
/// @custom:oz-upgrades-unsafe-allow constructor
3537
constructor() {
3638
_disableInitializers();
3739
}

0 commit comments

Comments
 (0)