Skip to content

Commit 0177f06

Browse files
committed
chore: bumped @kleros/kleros-v2-contracts, bumped hardhat
1 parent 5f474f2 commit 0177f06

File tree

4 files changed

+1688
-602
lines changed

4 files changed

+1688
-602
lines changed

contracts/deploy/00-reality-v2.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { HomeChains, isSkipped } from "./utils";
4+
import { DeploymentName, getContractsEthers } from "@kleros/kleros-v2-contracts";
45

56
const disputeTemplateFn = (chainId: number, arbitratorAddress: string) => `{
67
"title": "A reality.eth question",
@@ -33,28 +34,41 @@ const disputeTemplateFn = (chainId: number, arbitratorAddress: string) => `{
3334
const extraData =
3435
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003";
3536

37+
const NETWORK_TO_DEPLOYMENT: Record<string, DeploymentName> = {
38+
arbitrumSepoliaDevnet: "devnet",
39+
arbitrumSepolia: "testnet",
40+
arbitrum: "mainnetNeo",
41+
} as const;
42+
3643
const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
37-
const { deployments, getNamedAccounts, getChainId } = hre;
44+
const { deployments, getNamedAccounts, getChainId, ethers } = hre;
3845
const { deploy } = deployments;
3946

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

45-
const klerosCore = await deployments.get("KlerosCore");
46-
const disputeTemplateRegistry = await deployments.get("DisputeTemplateRegistry");
47-
const disputeTemplate = disputeTemplateFn(chainId, klerosCore.address);
52+
const networkName = deployments.getNetworkName();
53+
const deploymentName = NETWORK_TO_DEPLOYMENT[networkName];
54+
55+
if (!deploymentName)
56+
throw new Error(
57+
`Unsupported network: ${networkName}. Supported networks: ${Object.keys(NETWORK_TO_DEPLOYMENT).join(", ")}`
58+
);
59+
60+
const { klerosCore, disputeTemplateRegistry } = await getContractsEthers(ethers.provider, deploymentName);
61+
const disputeTemplate = disputeTemplateFn(chainId, klerosCore.target as string);
4862
const disputeTemplateMappings = "TODO";
4963

5064
await deploy("RealityV2", {
5165
from: deployer,
5266
args: [
53-
klerosCore.address,
67+
klerosCore.target,
5468
extraData,
5569
disputeTemplate,
5670
disputeTemplateMappings,
57-
disputeTemplateRegistry.address,
71+
disputeTemplateRegistry.target,
5872
600, // feeTimeout: 10 minutes
5973
],
6074
log: true,

contracts/hardhat.config.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,6 @@ const config: HardhatUserConfig = {
178178
mocha: {
179179
timeout: 20000,
180180
},
181-
external: {
182-
// https://github.com/wighawag/hardhat-deploy#importing-deployment-from-other-projects-with-truffle-support
183-
deployments: {
184-
localhost: process.env.HARDHAT_FORK
185-
? ["../node_modules/@kleros/kleros-v2-contracts/deployments/" + process.env.HARDHAT_FORK]
186-
: [],
187-
arbitrumSepoliaDevnet: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepoliaDevnet"],
188-
arbitrumSepolia: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepolia"],
189-
arbitrum: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrum"],
190-
},
191-
},
192181
};
193182

194183
export default config;

contracts/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,38 @@
5454
"@kleros/reality-v2-prettier-config": "workspace:^",
5555
"@kleros/reality-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",
68-
"abitype": "^0.10.3",
69-
"chai": "^4.2.0",
70-
"dotenv": "^16.3.1",
71-
"ethers": "^6.10.0",
68+
"abitype": "^1.0.8",
69+
"chai": "^4.5.0",
70+
"dotenv": "^16.5.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": {
88-
"@kleros/kleros-v2-contracts": "^0.7.0",
89-
"@openzeppelin/contracts": "^5.2.0"
88+
"@kleros/kleros-v2-contracts": "^0.9.2",
89+
"@openzeppelin/contracts": "^5.3.0"
9090
}
9191
}

0 commit comments

Comments
 (0)