Skip to content

Devnet redeployment #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Refresh the list of deployed contracts by running `./scripts/generateDeployments

#### Arbitrum Sepolia

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

#### Sepolia

Expand Down
34 changes: 23 additions & 11 deletions contracts/deploy/00-curate-v2.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { HomeChains, isSkipped } from "./utils";
import { CurateFactory, CurateV2 } from "../typechain-types";
import { registrationTemplate, removalTemplate, dataMappings } from "@kleros/curate-v2-templates";
import { DeploymentName, getContractsEthers } from "@kleros/kleros-v2-contracts";

const listMetadata = `{
"title": "Kleros Curate",
Expand All @@ -27,18 +27,30 @@ const listMetadata = `{
const extraData =
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003";

const NETWORK_TO_DEPLOYMENT: Record<string, DeploymentName> = {
arbitrumSepoliaDevnet: "devnet",
arbitrumSepolia: "testnet",
arbitrum: "mainnetNeo",
} as const;

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

// 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("deploying to %s with deployer %s", HomeChains[chainId], deployer);

const klerosCore = await deployments.get("KlerosCore");
const evidenceModule = await deployments.get("EvidenceModule");
const disputeTemplateRegistry = await deployments.get("DisputeTemplateRegistry");
const networkName = deployments.getNetworkName();
const deploymentName = NETWORK_TO_DEPLOYMENT[networkName];

if (!deploymentName)
throw new Error(
`Unsupported network: ${networkName}. Supported networks: ${Object.keys(NETWORK_TO_DEPLOYMENT).join(", ")}`
);

const { klerosCore, evidence, disputeTemplateRegistry } = await getContractsEthers(ethers.provider, deploymentName);
const fee = ethers.parseEther("0.00001");
const timeout = 600; // 10 minutes

Expand All @@ -52,12 +64,12 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const curate = (await ethers.getContract("CurateV2")) as CurateV2;
await curate.initialize(
deployer,
klerosCore.address,
klerosCore.target,
extraData,
evidenceModule.address,
evidence.target,
ethers.ZeroAddress, // _connectedTCR
{
templateRegistry: disputeTemplateRegistry.address,
templateRegistry: disputeTemplateRegistry.target,
registrationTemplateParameters: [registrationTemplate, dataMappings],
removalTemplateParameters: [removalTemplate, dataMappings],
},
Expand All @@ -76,12 +88,12 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const curateFactory = (await ethers.getContract("CurateFactory")) as CurateFactory;
await curateFactory.deploy(
deployer,
klerosCore.address,
klerosCore.target,
extraData,
evidenceModule.address,
evidence.target,
ethers.ZeroAddress, // _connectedTCR
{
templateRegistry: disputeTemplateRegistry.address,
templateRegistry: disputeTemplateRegistry.target,
registrationTemplateParameters: [registrationTemplate, ""],
removalTemplateParameters: [removalTemplate, ""],
},
Expand Down
44 changes: 22 additions & 22 deletions contracts/deployments/arbitrumSepoliaDevnet/CurateFactory.json

Large diffs are not rendered by default.

162 changes: 81 additions & 81 deletions contracts/deployments/arbitrumSepoliaDevnet/CurateV2.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions contracts/deployments/arbitrumSepoliaDevnet/CurateView.json

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dotenv.config();

const config: HardhatUserConfig = {
solidity: {
version: "0.8.18",
version: "0.8.24",
settings: {
optimizer: {
enabled: true,
Expand Down Expand Up @@ -179,17 +179,6 @@ const config: HardhatUserConfig = {
mocha: {
timeout: 20000,
},
external: {
// https://github.com/wighawag/hardhat-deploy#importing-deployment-from-other-projects-with-truffle-support
deployments: {
localhost: process.env.HARDHAT_FORK
? ["../node_modules/@kleros/kleros-v2-contracts/deployments/" + process.env.HARDHAT_FORK]
: [],
arbitrumSepoliaDevnet: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepoliaDevnet"],
arbitrumSepolia: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrumSepolia"],
arbitrum: ["../node_modules/@kleros/kleros-v2-contracts/deployments/arbitrum"],
},
},
};

export default config;
32 changes: 16 additions & 16 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@
"@kleros/curate-v2-prettier-config": "workspace:^",
"@kleros/curate-v2-tsconfig": "workspace:^",
"@logtail/pino": "^0.4.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@nomiclabs/hardhat-solhint": "^3.0.1",
"@typechain/ethers-v6": "^0.5.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
"@nomicfoundation/hardhat-ethers": "^3.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-verify": "^2.0.13",
"@nomiclabs/hardhat-solhint": "^3.1.0",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.2.0",
"@types/mocha": "^10.0.0",
"@types/node": "^16.0.0",
"@types/chai": "^4.3.20",
"@types/mocha": "^10.0.10",
"@types/node": "^16.18.126",
"@wagmi/cli": "^1.5.2",
"abitype": "^0.10.3",
"chai": "^4.2.0",
"dotenv": "^16.3.1",
"ethers": "^6.10.0",
"ethers": "^6.13.6",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"hardhat": "^2.19.0",
"hardhat-deploy": "^0.11.45",
"hardhat-deploy-ethers": "^0.4.1",
"hardhat": "^2.23.0",
"hardhat-deploy": "^1.0.2",
"hardhat-deploy-ethers": "^0.4.2",
"hardhat-docgen": "^1.3.0",
"hardhat-gas-reporter": "^1.0.8",
"hardhat-gas-reporter": "^1.0.10",
"hardhat-watcher": "^2.5.0",
"pino": "^8.17.0",
"pino-pretty": "^10.2.3",
"solidity-coverage": "^0.8.0",
"ts-node": "^8.0.0",
"typechain": "^8.3.0",
"typechain": "^8.3.2",
"typescript": "^5.1.3"
},
"dependencies": {
"@kleros/curate-v2-templates": "workspace:^",
"@kleros/kleros-v2-contracts": "^0.3.2"
"@kleros/kleros-v2-contracts": "^0.9.2"
}
}
2 changes: 1 addition & 1 deletion contracts/scripts/setDisputeTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ task("set-dispute-template", "Sets the dispute template").setAction(async (args,
console.log(`Found ${events.length} NewList events:`);
for (let i = 55; i < events.length; i++) {
const event = events[i];
const curate = await ethers.getContractAt("CurateV2", event.args._address);
const curate = await ethers.getContractAtWithSignerAddress<CurateV2>("CurateV2", event.args._address, deployer);
const governor = await curate.governor();
console.log(
`${i + 1}. List address: ${
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/CurateFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// @custom:bounties: []
/// @custom:deployments: []

pragma solidity 0.8.18;
pragma solidity 0.8.24;

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

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/CurateV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// @custom:bounties: []
/// @custom:deployments: []

pragma solidity 0.8.18;
pragma solidity 0.8.24;

import {IArbitrableV2, IArbitratorV2} from "@kleros/kleros-v2-contracts/arbitration/interfaces/IArbitrableV2.sol";
import {EvidenceModule} from "@kleros/kleros-v2-contracts/arbitration/evidence/EvidenceModule.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/CurateView.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// @custom:bounties: []
/// @custom:deployments: []

pragma solidity 0.8.18;
pragma solidity 0.8.24;

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

Expand Down
4 changes: 2 additions & 2 deletions subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kleros/curate-v2-subgraph",
"version": "0.1.4",
"version": "0.2.0",
"license": "MIT",
"scripts": {
"update:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@graphprotocol/graph-cli": "^0.95.0",
"@kleros/curate-v2-eslint-config": "workspace:^",
"@kleros/curate-v2-prettier-config": "workspace:^",
"gluegun": "^5.1.2",
"gluegun": "^5.2.0",
"matchstick-as": "0.6.0"
},
"dependenciesComments": {
Expand Down
4 changes: 2 additions & 2 deletions subgraph/src/Curate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function handleRuling(event: Ruling): void {

export function handleRequestChallenged(event: DisputeRequest): void {
let curate = Curate.bind(event.address);
let itemID = curate.arbitratorDisputeIDToItemID(event.params._arbitrator, event.params._arbitrableDisputeID);
let itemID = curate.arbitratorDisputeIDToItemID(event.params._arbitrator, event.params._arbitratorDisputeID);
let graphItemID = itemID.toHexString() + "@" + event.address.toHexString();
let item = Item.load(graphItemID);
if (!item) {
Expand Down Expand Up @@ -294,7 +294,7 @@ export function handleRequestChallenged(event: DisputeRequest): void {
request.disputed = true;
request.challenger = ensureUser(event.transaction.from.toHexString()).id;
request.challengeTime = event.block.timestamp;
request.disputeID = event.params._arbitrableDisputeID;
request.disputeID = event.params._arbitratorDisputeID;

request.save();
item.save();
Expand Down
4 changes: 2 additions & 2 deletions subgraph/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ dataSources:
name: CurateFactory
network: arbitrum-sepolia
source:
address: "0x1d7AEdcBBD73EE03313Ff6Ba32743d365b9A8a38"
address: "0x6f824A72d67bcF76f6F55C12F6E8FcAF531818bD"
abi: CurateFactory
startBlock: 34231352
startBlock: 143682381
mapping:
kind: ethereum/events
apiVersion: 0.0.6
Expand Down
2 changes: 1 addition & 1 deletion templates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const sharedTemplateProperties = `
"arbitrableChainID": "421614",
"arbitrableAddress": "{{arbitrableAddress}}",
"arbitratorChainID": "421614",
"arbitratorAddress": "0xD08Ab99480d02bf9C092828043f611BcDFEA917b",
"arbitratorAddress": "0x4838e31E0ea315232c431598110FE677cAF2D6E6",
"metadata": {
"itemName": "{{itemName}}",
"itemDescription": "{{itemDescription}}",
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"react-use": "^17.4.3",
"styled-components": "^5.3.11",
"subgraph-status": "^1.2.4",
"viem": "^2.22.22",
"viem": "^2.27.2",
"wagmi": "^2.14.10",
"zod": "^3.24.2"
}
Expand Down
Loading