Skip to content

Commit 7ce00c3

Browse files
authored
Merge pull request #1941 from kleros/chore/contracts-0.8-upgrade
Contracts 0.8 upgrade, subgraph to 0.14, devnet and testnet only for now
2 parents 6b062e8 + 2f2dbba commit 7ce00c3

File tree

81 files changed

+35570
-37957
lines changed

Some content is hidden

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

81 files changed

+35570
-37957
lines changed

contracts/README.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
3535
- [ChainlinkRNG](https://sepolia.arbiscan.io/address/0xAd5cCc93429e3A977c273cEeD106Ef16A69EAf79)
3636
- [DAI](https://sepolia.arbiscan.io/address/0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03)
3737
- [DAIFaucet](https://sepolia.arbiscan.io/address/0x1Fa58B52326488D62A406E71DBaD839560e810fF)
38-
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x0c38f115D001d3b5bBec5e8D44f78C7B61A27D94), [implementation](https://sepolia.arbiscan.io/address/0xDb0B7908C46E2Bb08459bf9b3155b9bb8F8713E1)
38+
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x0c38f115D001d3b5bBec5e8D44f78C7B61A27D94), [implementation](https://sepolia.arbiscan.io/address/0xCd4B2aD853027DbF7629003242CD609BDdaA89E1)
3939
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xed31bEE8b1F7cE89E93033C0d3B2ccF4cEb27652)
40-
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xe763d31Cb096B4bc7294012B78FC7F148324ebcb), [implementation](https://sepolia.arbiscan.io/address/0x7283c07CC5224B20f431B1fa0E6d6db3cA02de34)
41-
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397), [implementation](https://sepolia.arbiscan.io/address/0x63CF56e1c99E65E4a9eCDCC805F4735E016F2dc8)
42-
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479), [implementation](https://sepolia.arbiscan.io/address/0x0766e4B8c4a3aAC9371a5A9D6119E8125Adcfd55)
40+
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xe763d31Cb096B4bc7294012B78FC7F148324ebcb), [implementation](https://sepolia.arbiscan.io/address/0xf97791DA66e0A8Ff8Ee4908872CfCAcc641829Ec)
41+
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397), [implementation](https://sepolia.arbiscan.io/address/0xC4e64e6E949936a18269937FC1e18cb11E3db14D)
42+
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479), [implementation](https://sepolia.arbiscan.io/address/0x3Dc15eb9673b7228c69aBcF056d4c4044325fdf7)
4343
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0xd74e61A4dB9C6c3F2C97b62a319aE194f616858C)
4444
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x9f6ffc13B685A68ae359fCA128dfE776458Df464)
4545
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
46-
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2668c46A14af8997417138B064ca1bEB70769585), [implementation](https://sepolia.arbiscan.io/address/0xB958113f96950C7806d584eFBed964288d46a0B8)
46+
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2668c46A14af8997417138B064ca1bEB70769585), [implementation](https://sepolia.arbiscan.io/address/0x7CC8E0787e381aE159C4d3e137f20f9203313D41)
4747
- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0x51a97ad9F0aA818e75819da3cA20CAc319580627), [implementation](https://sepolia.arbiscan.io/address/0x1237F02bBeFDAEA20cE3A66aCAe458C4106Ae203)
48-
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xbAA5068F0bD1417046250A3eDe2B1F27e31383BD), [implementation](https://sepolia.arbiscan.io/address/0xA418a7E63DC8Aa0F379487E4445f86543C16A0E9)
48+
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xbAA5068F0bD1417046250A3eDe2B1F27e31383BD), [implementation](https://sepolia.arbiscan.io/address/0xAe750D6Fa39b1044d4081CB0bfecF886d176Be5b)
4949
- [TransactionBatcher](https://sepolia.arbiscan.io/address/0x35f93986950804ac1F93519BF68C2a7Dd776db0E)
5050
- [WETH](https://sepolia.arbiscan.io/address/0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511)
5151
- [WETHFaucet](https://sepolia.arbiscan.io/address/0x922B84134e41BC5c9EDE7D5EFCE22Ba3D0e71835)
@@ -77,27 +77,22 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
7777
- [ChainlinkRNG](https://sepolia.arbiscan.io/address/0x6c40D7F5d5bE3492fe9EF70e4eCb2BD773c12AF8)
7878
- [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5)
7979
- [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E)
80-
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8)
81-
- [DisputeKitClassicNeo: proxy](https://sepolia.arbiscan.io/address/0xd40aA608801a639E292e10C235B90488D04070b1), [implementation](https://sepolia.arbiscan.io/address/0xE636AB278fBfc8712E807c589A362dc2396d2d2F)
80+
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x2246821E1313A93e2F8CdF7a3422d078f560b457), [implementation](https://sepolia.arbiscan.io/address/0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24)
8281
- [DisputeKitClassicUniversity: proxy](https://sepolia.arbiscan.io/address/0xd6E96b7c993763B5CDDa1139C7387B82A7c8B8B5), [implementation](https://sepolia.arbiscan.io/address/0x87e863b94d2CB79A8aB53bD87Dc4A10E11C0918B)
83-
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xCE3d5F83d9da70d60ab9cee8b644a18EF3671E61)
84-
- [DisputeResolverNeo](https://sepolia.arbiscan.io/address/0xB73B124f2939959676509c37Ab6a41C8Ab4aDA1C)
82+
- [DisputeResolver](https://sepolia.arbiscan.io/address/0x524C5541f440204E0B4577334c439277018F971f)
8583
- [DisputeResolverRuler](https://sepolia.arbiscan.io/address/0x199893232ECC74cC7898B24b5Ff58d613029f6B7)
8684
- [DisputeResolverUniversity](https://sepolia.arbiscan.io/address/0x2Aa1a94307E772BeE42E9EfbD137b1053F1fCfd4)
87-
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E)
88-
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x57fd453FB0d16f8ca174E7386102D7170E17Be09), [implementation](https://sepolia.arbiscan.io/address/0x05AD81f245209b7f91885fd96e57c9da90554824)
89-
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xA54e7A16d7460e38a8F324eF46782FB520d58CE8), [implementation](https://sepolia.arbiscan.io/address/0x91a373BBdE0532F86410682F362e2Cf685e95085)
90-
- [KlerosCoreNeo: proxy](https://sepolia.arbiscan.io/address/0x26bf077037550e437605F07e25EfcAd510715C3A), [implementation](https://sepolia.arbiscan.io/address/0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB)
85+
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x45f0662ec4aA4164b187c1bd39D35D0E3168787a), [implementation](https://sepolia.arbiscan.io/address/0x0406ea6E28fAb9A23BF0d6f0f23f4352383A8592)
86+
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x990f44d19a5F46889801B31bf58e0536fBECf27C), [implementation](https://sepolia.arbiscan.io/address/0xf9f41910696DadF83a7B0b3e856a175D6aEEC8e8)
87+
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4838e31E0ea315232c431598110FE677cAF2D6E6), [implementation](https://sepolia.arbiscan.io/address/0xb6839061C3aD03c208EFd697409453bf9900cAb2)
9188
- [KlerosCoreRuler: proxy](https://sepolia.arbiscan.io/address/0x7ffcd32A0521645E6fCFd071A68F0e26957775a5), [implementation](https://sepolia.arbiscan.io/address/0x97e30A3A940856A3913437912C746f1aF6ccC76c)
92-
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0x9300D415af6e747ADe3C6cbA09a3b3CD5fb0c091)
89+
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0xa2425b724B32D40cbB85ea6e181cfb023CE9c014)
9390
- [KlerosCoreUniversity: proxy](https://sepolia.arbiscan.io/address/0x5AB37F38778Bc175852fA353056591D91c744ce6), [implementation](https://sepolia.arbiscan.io/address/0xF74DaBfC5F5dbdBD07636637204d9C35326D2906)
9491
- [KlerosV2NeoEarlyUser](https://sepolia.arbiscan.io/address/0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F)
9592
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)
9693
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
97-
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E)
98-
- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005)
99-
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x19cb28BAB40C3585955798f5EEabd71Eec14471C), [implementation](https://sepolia.arbiscan.io/address/0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3)
100-
- [SortitionModuleNeo: proxy](https://sepolia.arbiscan.io/address/0x809533c303c10915BB5c0585f2d8D738e2a4fB64), [implementation](https://sepolia.arbiscan.io/address/0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0)
94+
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x31d067405184d7FaA64b0834511cBcFAF32CdC4b), [implementation](https://sepolia.arbiscan.io/address/0x09ba3234B3aD786aE46EcDAF388C93D54c145DC0)
95+
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xb34651b65A40553C444c6F0D27286C80ec34fbfD), [implementation](https://sepolia.arbiscan.io/address/0xB37919A50d3BddA9982e3c84aA47e501c454364B)
10196
- [SortitionModuleUniversity: proxy](https://sepolia.arbiscan.io/address/0x4B2c2d048921f694cCE3AEa35698c6B1f5fcbb79), [implementation](https://sepolia.arbiscan.io/address/0x5CAD621D69E0535422aCFaCC0017bC32beC7A486)
10297
- [TransactionBatcher](https://sepolia.arbiscan.io/address/0x35f93986950804ac1F93519BF68C2a7Dd776db0E)
10398
- [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138)

contracts/deploy/upgrade-all.ts

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { HardhatRuntimeEnvironment } from "hardhat/types";
2+
import { DeployFunction } from "hardhat-deploy/types";
3+
import { prompt, print } from "gluegun";
4+
import { deployUpgradable } from "./utils/deployUpgradable";
5+
import { HomeChains, isSkipped } from "./utils";
6+
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
7+
8+
const { bold } = print.colors;
9+
10+
const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
11+
const { deployments, getNamedAccounts, getChainId } = hre;
12+
13+
// fallback to hardhat node signers on local network
14+
const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address;
15+
const chainId = Number(await getChainId());
16+
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
17+
18+
const { disputeKitClassic, disputeTemplateRegistry, evidence, core, policyRegistry, sortition } =
19+
await getContractNamesFromNetwork(hre);
20+
21+
const upgrade = async (contractName: string, initializer: string, args: any[]) => {
22+
try {
23+
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
24+
await hre.run("compare-storage", { contract: contractName });
25+
print.newline();
26+
print.highlight(`💣 Upgrading ${bold(contractName)}`);
27+
const { confirm } = await prompt.ask({
28+
type: "confirm",
29+
name: "confirm",
30+
message: "Are you sure you want to proceed?",
31+
});
32+
if (!confirm) {
33+
print.info("Operation cancelled by user.");
34+
return;
35+
}
36+
print.info(`Upgrading ${contractName}...`);
37+
38+
await deployUpgradable(deployments, contractName, {
39+
newImplementation: contractName,
40+
initializer,
41+
from: deployer,
42+
args, // Warning: do not reinitialize existing state variables, only the new ones
43+
});
44+
45+
print.info(`Verifying ${contractName} on Etherscan...`);
46+
await hre.run("etherscan-verify", { contractName: `${contractName}_Implementation` });
47+
} catch (err) {
48+
console.error(err);
49+
throw err;
50+
}
51+
};
52+
53+
await upgrade(disputeKitClassic, "initialize2", []);
54+
await upgrade(disputeTemplateRegistry, "initialize2", []);
55+
await upgrade(evidence, "initialize2", []);
56+
await upgrade(core, "initialize3", []);
57+
await upgrade(policyRegistry, "initialize2", []);
58+
await upgrade(sortition, "initialize3", []);
59+
};
60+
61+
deployUpgradeAll.tags = ["UpgradeAll"];
62+
deployUpgradeAll.skip = async ({ network }) => {
63+
return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
64+
};
65+
66+
export default deployUpgradeAll;

contracts/deploy/upgrade-dispute-kit.ts renamed to contracts/deploy/upgrade-dispute-kit-v0.8.0.ts

+22-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { deployUpgradable } from "./utils/deployUpgradable";
44
import { HomeChains, isSkipped } from "./utils";
5+
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
6+
import { print, prompt } from "gluegun";
7+
8+
const { bold } = print.colors;
59

610
const deployUpgradeDisputeKit: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
711
const { deployments, getNamedAccounts, getChainId } = hre;
@@ -12,10 +16,24 @@ const deployUpgradeDisputeKit: DeployFunction = async (hre: HardhatRuntimeEnviro
1216
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
1317

1418
try {
15-
console.log("upgrading DisputeKitClassicNeo...");
16-
await deployUpgradable(deployments, "DisputeKitClassicNeo", {
17-
contract: "DisputeKitClassic",
18-
initializer: "initialize",
19+
const { disputeKitClassic: contractName } = await getContractNamesFromNetwork(hre);
20+
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
21+
await hre.run("compare-storage", { contract: contractName });
22+
print.newline();
23+
print.highlight(`💣 Upgrading ${bold(contractName)}`);
24+
const { confirm } = await prompt.ask({
25+
type: "confirm",
26+
name: "confirm",
27+
message: "Are you sure you want to proceed?",
28+
});
29+
if (!confirm) {
30+
print.info("Operation cancelled by user.");
31+
return;
32+
}
33+
print.info(`Upgrading ${contractName}...`);
34+
await deployUpgradable(deployments, contractName, {
35+
contract: contractName,
36+
initializer: "initialize2",
1937
from: deployer,
2038
// Warning: do not reinitialize everything, only the new variables
2139
args: [],

contracts/deploy/upgrade-kleros-core.ts renamed to contracts/deploy/upgrade-kleros-core-v0.8.0.ts

+22-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { deployUpgradable } from "./utils/deployUpgradable";
44
import { HomeChains, isSkipped } from "./utils";
5+
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
6+
import { print, prompt } from "gluegun";
7+
8+
const { bold } = print.colors;
59

610
const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
711
const { deployments, getNamedAccounts, getChainId } = hre;
@@ -12,10 +16,24 @@ const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnviro
1216
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
1317

1418
try {
15-
console.log("upgrading KlerosCoreNeo...");
16-
await deployUpgradable(deployments, "KlerosCoreNeo", {
17-
newImplementation: "KlerosCoreNeo",
18-
initializer: "initialize",
19+
const { core: contractName } = await getContractNamesFromNetwork(hre);
20+
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
21+
await hre.run("compare-storage", { contract: contractName });
22+
print.newline();
23+
print.highlight(`💣 Upgrading ${bold(contractName)}`);
24+
const { confirm } = await prompt.ask({
25+
type: "confirm",
26+
name: "confirm",
27+
message: "Are you sure you want to proceed?",
28+
});
29+
if (!confirm) {
30+
print.info("Operation cancelled by user.");
31+
return;
32+
}
33+
print.info(`Upgrading ${contractName}...`);
34+
await deployUpgradable(deployments, contractName, {
35+
contract: contractName,
36+
initializer: "initialize3",
1937
from: deployer,
2038
// Warning: do not reinitialize everything, only the new variables
2139
args: [],

contracts/deploy/upgrade-sortition-module-v0.9.0.ts renamed to contracts/deploy/upgrade-sortition-module-v0.8.0.ts

+21-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { deployUpgradable } from "./utils/deployUpgradable";
44
import { HomeChains, isSkipped } from "./utils";
5+
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
6+
import { print, prompt } from "gluegun";
7+
8+
const { bold } = print.colors;
59

610
const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
711
const { deployments, getNamedAccounts, getChainId } = hre;
@@ -12,9 +16,23 @@ const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeE
1216
console.log("upgrading on %s with deployer %s", HomeChains[chainId], deployer);
1317

1418
try {
15-
console.log("upgrading SortitionModuleNeo...");
16-
await deployUpgradable(deployments, "SortitionModuleNeo", {
17-
newImplementation: "SortitionModuleNeo",
19+
const { sortition: contractName } = await getContractNamesFromNetwork(hre);
20+
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
21+
await hre.run("compare-storage", { contract: contractName });
22+
print.newline();
23+
print.highlight(`💣 Upgrading ${bold(contractName)}`);
24+
const { confirm } = await prompt.ask({
25+
type: "confirm",
26+
name: "confirm",
27+
message: "Are you sure you want to proceed?",
28+
});
29+
if (!confirm) {
30+
print.info("Operation cancelled by user.");
31+
return;
32+
}
33+
print.info(`Upgrading ${contractName}...`);
34+
await deployUpgradable(deployments, contractName, {
35+
contract: contractName,
1836
initializer: "initialize3",
1937
from: deployer,
2038
// Warning: do not reinitialize everything, only the new variables

0 commit comments

Comments
 (0)