Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
- [ChainlinkRNG](https://sepolia.arbiscan.io/address/0xAd5cCc93429e3A977c273cEeD106Ef16A69EAf79)
- [DAI](https://sepolia.arbiscan.io/address/0xc34aeFEa232956542C5b2f2EE55fD5c378B35c03)
- [DAIFaucet](https://sepolia.arbiscan.io/address/0x1Fa58B52326488D62A406E71DBaD839560e810fF)
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x0c38f115D001d3b5bBec5e8D44f78C7B61A27D94), [implementation](https://sepolia.arbiscan.io/address/0xDb0B7908C46E2Bb08459bf9b3155b9bb8F8713E1)
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x0c38f115D001d3b5bBec5e8D44f78C7B61A27D94), [implementation](https://sepolia.arbiscan.io/address/0xCd4B2aD853027DbF7629003242CD609BDdaA89E1)
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xed31bEE8b1F7cE89E93033C0d3B2ccF4cEb27652)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xe763d31Cb096B4bc7294012B78FC7F148324ebcb), [implementation](https://sepolia.arbiscan.io/address/0x7283c07CC5224B20f431B1fa0E6d6db3cA02de34)
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397), [implementation](https://sepolia.arbiscan.io/address/0x63CF56e1c99E65E4a9eCDCC805F4735E016F2dc8)
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479), [implementation](https://sepolia.arbiscan.io/address/0x0766e4B8c4a3aAC9371a5A9D6119E8125Adcfd55)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0xe763d31Cb096B4bc7294012B78FC7F148324ebcb), [implementation](https://sepolia.arbiscan.io/address/0xf97791DA66e0A8Ff8Ee4908872CfCAcc641829Ec)
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397), [implementation](https://sepolia.arbiscan.io/address/0xC4e64e6E949936a18269937FC1e18cb11E3db14D)
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479), [implementation](https://sepolia.arbiscan.io/address/0x3Dc15eb9673b7228c69aBcF056d4c4044325fdf7)
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0xd74e61A4dB9C6c3F2C97b62a319aE194f616858C)
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x9f6ffc13B685A68ae359fCA128dfE776458Df464)
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2668c46A14af8997417138B064ca1bEB70769585), [implementation](https://sepolia.arbiscan.io/address/0xB958113f96950C7806d584eFBed964288d46a0B8)
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2668c46A14af8997417138B064ca1bEB70769585), [implementation](https://sepolia.arbiscan.io/address/0x7CC8E0787e381aE159C4d3e137f20f9203313D41)
- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0x51a97ad9F0aA818e75819da3cA20CAc319580627), [implementation](https://sepolia.arbiscan.io/address/0x1237F02bBeFDAEA20cE3A66aCAe458C4106Ae203)
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xbAA5068F0bD1417046250A3eDe2B1F27e31383BD), [implementation](https://sepolia.arbiscan.io/address/0xA418a7E63DC8Aa0F379487E4445f86543C16A0E9)
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xbAA5068F0bD1417046250A3eDe2B1F27e31383BD), [implementation](https://sepolia.arbiscan.io/address/0xAe750D6Fa39b1044d4081CB0bfecF886d176Be5b)
- [TransactionBatcher](https://sepolia.arbiscan.io/address/0x35f93986950804ac1F93519BF68C2a7Dd776db0E)
- [WETH](https://sepolia.arbiscan.io/address/0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511)
- [WETHFaucet](https://sepolia.arbiscan.io/address/0x922B84134e41BC5c9EDE7D5EFCE22Ba3D0e71835)
Expand Down Expand Up @@ -77,27 +77,22 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
- [ChainlinkRNG](https://sepolia.arbiscan.io/address/0x6c40D7F5d5bE3492fe9EF70e4eCb2BD773c12AF8)
- [DAI](https://sepolia.arbiscan.io/address/0x593e89704D285B0c3fbF157c7CF2537456CE64b5)
- [DAIFaucet](https://sepolia.arbiscan.io/address/0xB5b39A1bcD2D7097A8824B3cC18Ebd2dFb0D9B5E)
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x9426F127116C3652A262AE1eA48391AC8F44D35b), [implementation](https://sepolia.arbiscan.io/address/0x692CC78F2570181FFB99297965FeAA8352ab12E8)
- [DisputeKitClassicNeo: proxy](https://sepolia.arbiscan.io/address/0xd40aA608801a639E292e10C235B90488D04070b1), [implementation](https://sepolia.arbiscan.io/address/0xE636AB278fBfc8712E807c589A362dc2396d2d2F)
- [DisputeKitClassic: proxy](https://sepolia.arbiscan.io/address/0x2246821E1313A93e2F8CdF7a3422d078f560b457), [implementation](https://sepolia.arbiscan.io/address/0xc51Ac08b07832Cf9b51Ff9E9dd3E85a3D205ff24)
- [DisputeKitClassicUniversity: proxy](https://sepolia.arbiscan.io/address/0xd6E96b7c993763B5CDDa1139C7387B82A7c8B8B5), [implementation](https://sepolia.arbiscan.io/address/0x87e863b94d2CB79A8aB53bD87Dc4A10E11C0918B)
- [DisputeResolver](https://sepolia.arbiscan.io/address/0xCE3d5F83d9da70d60ab9cee8b644a18EF3671E61)
- [DisputeResolverNeo](https://sepolia.arbiscan.io/address/0xB73B124f2939959676509c37Ab6a41C8Ab4aDA1C)
- [DisputeResolver](https://sepolia.arbiscan.io/address/0x524C5541f440204E0B4577334c439277018F971f)
- [DisputeResolverRuler](https://sepolia.arbiscan.io/address/0x199893232ECC74cC7898B24b5Ff58d613029f6B7)
- [DisputeResolverUniversity](https://sepolia.arbiscan.io/address/0x2Aa1a94307E772BeE42E9EfbD137b1053F1fCfd4)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x596D3B09E684D62217682216e9b7a0De75933391), [implementation](https://sepolia.arbiscan.io/address/0xE00A43d3c3321A0e210F2F8bE2F3F75eC8a4951E)
- [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)
- [KlerosCoreNeo: proxy](https://sepolia.arbiscan.io/address/0x26bf077037550e437605F07e25EfcAd510715C3A), [implementation](https://sepolia.arbiscan.io/address/0x3bE96b7eAF6A3640DBa1f7CE58776D5b790B74CB)
- [DisputeTemplateRegistry: proxy](https://sepolia.arbiscan.io/address/0x45f0662ec4aA4164b187c1bd39D35D0E3168787a), [implementation](https://sepolia.arbiscan.io/address/0x0406ea6E28fAb9A23BF0d6f0f23f4352383A8592)
- [EvidenceModule: proxy](https://sepolia.arbiscan.io/address/0x990f44d19a5F46889801B31bf58e0536fBECf27C), [implementation](https://sepolia.arbiscan.io/address/0xf9f41910696DadF83a7B0b3e856a175D6aEEC8e8)
- [KlerosCore: proxy](https://sepolia.arbiscan.io/address/0x4838e31E0ea315232c431598110FE677cAF2D6E6), [implementation](https://sepolia.arbiscan.io/address/0xb6839061C3aD03c208EFd697409453bf9900cAb2)
- [KlerosCoreRuler: proxy](https://sepolia.arbiscan.io/address/0x7ffcd32A0521645E6fCFd071A68F0e26957775a5), [implementation](https://sepolia.arbiscan.io/address/0x97e30A3A940856A3913437912C746f1aF6ccC76c)
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0x9300D415af6e747ADe3C6cbA09a3b3CD5fb0c091)
- [KlerosCoreSnapshotProxy](https://sepolia.arbiscan.io/address/0xa2425b724B32D40cbB85ea6e181cfb023CE9c014)
- [KlerosCoreUniversity: proxy](https://sepolia.arbiscan.io/address/0x5AB37F38778Bc175852fA353056591D91c744ce6), [implementation](https://sepolia.arbiscan.io/address/0xF74DaBfC5F5dbdBD07636637204d9C35326D2906)
- [KlerosV2NeoEarlyUser](https://sepolia.arbiscan.io/address/0x0d60Ff8bbCF49Bc5352328E7E28e141834d7750F)
- [PNKFaucet](https://sepolia.arbiscan.io/address/0x7EFE468003Ad6A858b5350CDE0A67bBED58739dD)
- [PinakionV2](https://sepolia.arbiscan.io/address/0x34B944D42cAcfC8266955D07A80181D2054aa225)
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da), [implementation](https://sepolia.arbiscan.io/address/0xAA637C9E2831614158d7eB193D03af4a7223C56E)
- [RandomizerRNG: proxy](https://sepolia.arbiscan.io/address/0xA995C172d286f8F4eE137CC662e2844E59Cf4836), [implementation](https://sepolia.arbiscan.io/address/0xe62B776498F48061ef9425fCEf30F3d1370DB005)
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0x19cb28BAB40C3585955798f5EEabd71Eec14471C), [implementation](https://sepolia.arbiscan.io/address/0xBC82B29e5aE8a749D82b7919118Ab7C0D41fA3D3)
- [SortitionModuleNeo: proxy](https://sepolia.arbiscan.io/address/0x809533c303c10915BB5c0585f2d8D738e2a4fB64), [implementation](https://sepolia.arbiscan.io/address/0xD9ddceb7C399518F23b69D155a67C6AFF13f9fF0)
- [PolicyRegistry: proxy](https://sepolia.arbiscan.io/address/0x31d067405184d7FaA64b0834511cBcFAF32CdC4b), [implementation](https://sepolia.arbiscan.io/address/0x09ba3234B3aD786aE46EcDAF388C93D54c145DC0)
- [SortitionModule: proxy](https://sepolia.arbiscan.io/address/0xb34651b65A40553C444c6F0D27286C80ec34fbfD), [implementation](https://sepolia.arbiscan.io/address/0xB37919A50d3BddA9982e3c84aA47e501c454364B)
- [SortitionModuleUniversity: proxy](https://sepolia.arbiscan.io/address/0x4B2c2d048921f694cCE3AEa35698c6B1f5fcbb79), [implementation](https://sepolia.arbiscan.io/address/0x5CAD621D69E0535422aCFaCC0017bC32beC7A486)
- [TransactionBatcher](https://sepolia.arbiscan.io/address/0x35f93986950804ac1F93519BF68C2a7Dd776db0E)
- [WETH](https://sepolia.arbiscan.io/address/0x3829A2486d53ee984a0ca2D76552715726b77138)
Expand Down
66 changes: 66 additions & 0 deletions contracts/deploy/upgrade-all.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { prompt, print } from "gluegun";
import { deployUpgradable } from "./utils/deployUpgradable";
import { HomeChains, isSkipped } from "./utils";
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";

const { bold } = print.colors;

const deployUpgradeAll: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts, getChainId } = hre;

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

const { disputeKitClassic, disputeTemplateRegistry, evidence, core, policyRegistry, sortition } =
await getContractNamesFromNetwork(hre);

const upgrade = async (contractName: string, initializer: string, args: any[]) => {
try {
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
await hre.run("compare-storage", { contract: contractName });
print.newline();
print.highlight(`💣 Upgrading ${bold(contractName)}`);
const { confirm } = await prompt.ask({
type: "confirm",
name: "confirm",
message: "Are you sure you want to proceed?",
});
if (!confirm) {
print.info("Operation cancelled by user.");
return;
}
print.info(`Upgrading ${contractName}...`);

await deployUpgradable(deployments, contractName, {
newImplementation: contractName,
initializer,
from: deployer,
args, // Warning: do not reinitialize existing state variables, only the new ones
});

print.info(`Verifying ${contractName} on Etherscan...`);
await hre.run("etherscan-verify", { contractName: `${contractName}_Implementation` });
} catch (err) {
console.error(err);
throw err;
}
};

await upgrade(disputeKitClassic, "initialize2", []);
await upgrade(disputeTemplateRegistry, "initialize2", []);
await upgrade(evidence, "initialize2", []);
await upgrade(core, "initialize3", []);
await upgrade(policyRegistry, "initialize2", []);
await upgrade(sortition, "initialize3", []);
};

deployUpgradeAll.tags = ["UpgradeAll"];
deployUpgradeAll.skip = async ({ network }) => {
return isSkipped(network, !HomeChains[network.config.chainId ?? 0]);
};

export default deployUpgradeAll;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployUpgradable } from "./utils/deployUpgradable";
import { HomeChains, isSkipped } from "./utils";
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
import { print, prompt } from "gluegun";

const { bold } = print.colors;

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

try {
console.log("upgrading DisputeKitClassicNeo...");
await deployUpgradable(deployments, "DisputeKitClassicNeo", {
contract: "DisputeKitClassic",
initializer: "initialize",
const { disputeKitClassic: contractName } = await getContractNamesFromNetwork(hre);
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
await hre.run("compare-storage", { contract: contractName });
print.newline();
print.highlight(`💣 Upgrading ${bold(contractName)}`);
const { confirm } = await prompt.ask({
type: "confirm",
name: "confirm",
message: "Are you sure you want to proceed?",
});
if (!confirm) {
print.info("Operation cancelled by user.");
return;
}
print.info(`Upgrading ${contractName}...`);
await deployUpgradable(deployments, contractName, {
contract: contractName,
initializer: "initialize2",
from: deployer,
// Warning: do not reinitialize everything, only the new variables
args: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployUpgradable } from "./utils/deployUpgradable";
import { HomeChains, isSkipped } from "./utils";
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
import { print, prompt } from "gluegun";

const { bold } = print.colors;

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

try {
console.log("upgrading KlerosCoreNeo...");
await deployUpgradable(deployments, "KlerosCoreNeo", {
newImplementation: "KlerosCoreNeo",
initializer: "initialize",
const { core: contractName } = await getContractNamesFromNetwork(hre);
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
await hre.run("compare-storage", { contract: contractName });
print.newline();
print.highlight(`💣 Upgrading ${bold(contractName)}`);
const { confirm } = await prompt.ask({
type: "confirm",
name: "confirm",
message: "Are you sure you want to proceed?",
});
if (!confirm) {
print.info("Operation cancelled by user.");
return;
}
print.info(`Upgrading ${contractName}...`);
await deployUpgradable(deployments, contractName, {
contract: contractName,
initializer: "initialize3",
from: deployer,
// Warning: do not reinitialize everything, only the new variables
args: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployUpgradable } from "./utils/deployUpgradable";
import { HomeChains, isSkipped } from "./utils";
import { getContractNamesFromNetwork } from "../scripts/utils/contracts";
import { print, prompt } from "gluegun";

const { bold } = print.colors;

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

try {
console.log("upgrading SortitionModuleNeo...");
await deployUpgradable(deployments, "SortitionModuleNeo", {
newImplementation: "SortitionModuleNeo",
const { sortition: contractName } = await getContractNamesFromNetwork(hre);
print.highlight(`🔍 Validating upgrade of ${bold(contractName)}`);
await hre.run("compare-storage", { contract: contractName });
print.newline();
print.highlight(`💣 Upgrading ${bold(contractName)}`);
const { confirm } = await prompt.ask({
type: "confirm",
name: "confirm",
message: "Are you sure you want to proceed?",
});
if (!confirm) {
print.info("Operation cancelled by user.");
return;
}
print.info(`Upgrading ${contractName}...`);
await deployUpgradable(deployments, contractName, {
contract: contractName,
initializer: "initialize3",
from: deployer,
// Warning: do not reinitialize everything, only the new variables
Expand Down
Loading
Loading