Skip to content

Commit 6461ba6

Browse files
authored
Merge pull request #77 from kleros/chore/redeploy
Devnet redeployment
2 parents e6c6c04 + 173a6ce commit 6461ba6

File tree

17 files changed

+1652
-848
lines changed

17 files changed

+1652
-848
lines changed

contracts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments
1616

1717
#### Arbitrum Sepolia
1818

19-
- [CurateFactory](https://sepolia.arbiscan.io/address/0x1d7AEdcBBD73EE03313Ff6Ba32743d365b9A8a38)
20-
- [CurateV2](https://sepolia.arbiscan.io/address/0xd7f802cBccF319e43F58676d2717eEB0337B28D1)
21-
- [CurateView](https://sepolia.arbiscan.io/address/0x0A86bC3D20a0205733383F3bB08166D5C6608f9E)
19+
- [CurateFactory](https://sepolia.arbiscan.io/address/0x6f824A72d67bcF76f6F55C12F6E8FcAF531818bD)
20+
- [CurateV2](https://sepolia.arbiscan.io/address/0xed1f06a9963D2B2D5f2176b2dFFaaf03FC909531)
21+
- [CurateView](https://sepolia.arbiscan.io/address/0x61DAadc87f1e0889407d2Fd725eAEB79E2B5cF80)
2222

2323
#### Sepolia
2424

contracts/deploy/00-curate-v2.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { ethers } from "hardhat";
21
import { HardhatRuntimeEnvironment } from "hardhat/types";
32
import { DeployFunction } from "hardhat-deploy/types";
43
import { HomeChains, isSkipped } from "./utils";
54
import { CurateFactory, CurateV2 } from "../typechain-types";
65
import { registrationTemplate, removalTemplate, dataMappings } from "@kleros/curate-v2-templates";
6+
import { DeploymentName, getContractsEthers } from "@kleros/kleros-v2-contracts";
77

88
const listMetadata = `{
99
"title": "Kleros Curate",
@@ -27,18 +27,30 @@ const listMetadata = `{
2727
const extraData =
2828
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003";
2929

30+
const NETWORK_TO_DEPLOYMENT: Record<string, DeploymentName> = {
31+
arbitrumSepoliaDevnet: "devnet",
32+
arbitrumSepolia: "testnet",
33+
arbitrum: "mainnetNeo",
34+
} as const;
35+
3036
const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
31-
const { deployments, getNamedAccounts, getChainId } = hre;
37+
const { deployments, getNamedAccounts, getChainId, ethers } = hre;
3238
const { deploy } = deployments;
3339

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

39-
const klerosCore = await deployments.get("KlerosCore");
40-
const evidenceModule = await deployments.get("EvidenceModule");
41-
const disputeTemplateRegistry = await deployments.get("DisputeTemplateRegistry");
45+
const networkName = deployments.getNetworkName();
46+
const deploymentName = NETWORK_TO_DEPLOYMENT[networkName];
47+
48+
if (!deploymentName)
49+
throw new Error(
50+
`Unsupported network: ${networkName}. Supported networks: ${Object.keys(NETWORK_TO_DEPLOYMENT).join(", ")}`
51+
);
52+
53+
const { klerosCore, evidence, disputeTemplateRegistry } = await getContractsEthers(ethers.provider, deploymentName);
4254
const fee = ethers.parseEther("0.00001");
4355
const timeout = 600; // 10 minutes
4456

@@ -52,12 +64,12 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
5264
const curate = (await ethers.getContract("CurateV2")) as CurateV2;
5365
await curate.initialize(
5466
deployer,
55-
klerosCore.address,
67+
klerosCore.target,
5668
extraData,
57-
evidenceModule.address,
69+
evidence.target,
5870
ethers.ZeroAddress, // _connectedTCR
5971
{
60-
templateRegistry: disputeTemplateRegistry.address,
72+
templateRegistry: disputeTemplateRegistry.target,
6173
registrationTemplateParameters: [registrationTemplate, dataMappings],
6274
removalTemplateParameters: [removalTemplate, dataMappings],
6375
},
@@ -76,12 +88,12 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
7688
const curateFactory = (await ethers.getContract("CurateFactory")) as CurateFactory;
7789
await curateFactory.deploy(
7890
deployer,
79-
klerosCore.address,
91+
klerosCore.target,
8092
extraData,
81-
evidenceModule.address,
93+
evidence.target,
8294
ethers.ZeroAddress, // _connectedTCR
8395
{
84-
templateRegistry: disputeTemplateRegistry.address,
96+
templateRegistry: disputeTemplateRegistry.target,
8597
registrationTemplateParameters: [registrationTemplate, ""],
8698
removalTemplateParameters: [removalTemplate, ""],
8799
},

contracts/deployments/arbitrumSepoliaDevnet/CurateFactory.json

Lines changed: 22 additions & 22 deletions
Large diffs are not rendered by default.

contracts/deployments/arbitrumSepoliaDevnet/CurateV2.json

Lines changed: 81 additions & 81 deletions
Large diffs are not rendered by default.

contracts/deployments/arbitrumSepoliaDevnet/CurateView.json

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

contracts/hardhat.config.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dotenv.config();
1818

1919
const config: HardhatUserConfig = {
2020
solidity: {
21-
version: "0.8.18",
21+
version: "0.8.24",
2222
settings: {
2323
optimizer: {
2424
enabled: true,
@@ -179,17 +179,6 @@ const config: HardhatUserConfig = {
179179
mocha: {
180180
timeout: 20000,
181181
},
182-
external: {
183-
// https://github.com/wighawag/hardhat-deploy#importing-deployment-from-other-projects-with-truffle-support
184-
deployments: {
185-
localhost: process.env.HARDHAT_FORK
186-
? ["../node_modules/@kleros/kleros-v2-contracts/deployments/" + process.env.HARDHAT_FORK]
187-
: [],
188-
arbitrumSepoliaDevnet: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepoliaDevnet"],
189-
arbitrumSepolia: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepolia"],
190-
arbitrum: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrum"],
191-
},
192-
},
193182
};
194183

195184
export default config;

contracts/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,38 @@
5454
"@kleros/curate-v2-prettier-config": "workspace:^",
5555
"@kleros/curate-v2-tsconfig": "workspace:^",
5656
"@logtail/pino": "^0.4.0",
57-
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
58-
"@nomicfoundation/hardhat-ethers": "^3.0.0",
59-
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
60-
"@nomicfoundation/hardhat-verify": "^2.0.0",
61-
"@nomiclabs/hardhat-solhint": "^3.0.1",
62-
"@typechain/ethers-v6": "^0.5.0",
57+
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
58+
"@nomicfoundation/hardhat-ethers": "^3.0.8",
59+
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
60+
"@nomicfoundation/hardhat-verify": "^2.0.13",
61+
"@nomiclabs/hardhat-solhint": "^3.1.0",
62+
"@typechain/ethers-v6": "^0.5.1",
6363
"@typechain/hardhat": "^9.1.0",
64-
"@types/chai": "^4.2.0",
65-
"@types/mocha": "^10.0.0",
66-
"@types/node": "^16.0.0",
64+
"@types/chai": "^4.3.20",
65+
"@types/mocha": "^10.0.10",
66+
"@types/node": "^16.18.126",
6767
"@wagmi/cli": "^1.5.2",
6868
"abitype": "^0.10.3",
6969
"chai": "^4.2.0",
7070
"dotenv": "^16.3.1",
71-
"ethers": "^6.10.0",
71+
"ethers": "^6.13.6",
7272
"graphql": "^16.8.1",
7373
"graphql-request": "^6.1.0",
74-
"hardhat": "^2.19.0",
75-
"hardhat-deploy": "^0.11.45",
76-
"hardhat-deploy-ethers": "^0.4.1",
74+
"hardhat": "^2.23.0",
75+
"hardhat-deploy": "^1.0.2",
76+
"hardhat-deploy-ethers": "^0.4.2",
7777
"hardhat-docgen": "^1.3.0",
78-
"hardhat-gas-reporter": "^1.0.8",
78+
"hardhat-gas-reporter": "^1.0.10",
7979
"hardhat-watcher": "^2.5.0",
8080
"pino": "^8.17.0",
8181
"pino-pretty": "^10.2.3",
8282
"solidity-coverage": "^0.8.0",
8383
"ts-node": "^8.0.0",
84-
"typechain": "^8.3.0",
84+
"typechain": "^8.3.2",
8585
"typescript": "^5.1.3"
8686
},
8787
"dependencies": {
8888
"@kleros/curate-v2-templates": "workspace:^",
89-
"@kleros/kleros-v2-contracts": "^0.3.2"
89+
"@kleros/kleros-v2-contracts": "^0.9.2"
9090
}
9191
}

contracts/scripts/setDisputeTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ task("set-dispute-template", "Sets the dispute template").setAction(async (args,
2727
console.log(`Found ${events.length} NewList events:`);
2828
for (let i = 55; i < events.length; i++) {
2929
const event = events[i];
30-
const curate = await ethers.getContractAt("CurateV2", event.args._address);
30+
const curate = await ethers.getContractAtWithSignerAddress<CurateV2>("CurateV2", event.args._address, deployer);
3131
const governor = await curate.governor();
3232
console.log(
3333
`${i + 1}. List address: ${

contracts/src/CurateFactory.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// @custom:bounties: []
77
/// @custom:deployments: []
88

9-
pragma solidity 0.8.18;
9+
pragma solidity 0.8.24;
1010

1111
import {CurateV2, IArbitratorV2, EvidenceModule} from "./CurateV2.sol";
1212

contracts/src/CurateV2.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// @custom:bounties: []
77
/// @custom:deployments: []
88

9-
pragma solidity 0.8.18;
9+
pragma solidity 0.8.24;
1010

1111
import {IArbitrableV2, IArbitratorV2} from "@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol";
1212
import {EvidenceModule} from "@kleros/kleros-v2-contracts/arbitration/evidence/EvidenceModule.sol";

0 commit comments

Comments
 (0)