Skip to content

Commit a283469

Browse files
committed
chore: setDisputeTemplate script
1 parent 07399b2 commit a283469

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

contracts/hardhat.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import "hardhat-deploy";
1010
import "hardhat-deploy-ethers";
1111
import "hardhat-watcher";
1212
import "hardhat-docgen";
13+
require("./scripts/setDisputeTemplate");
1314
// import "hardhat-contract-sizer"; // prevents hardhat-deploy from finding chalk...
1415
// import "hardhat-tracer"; // prevents hardhat-deploy from finding chalk...
1516

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { task } from "hardhat/config";
2+
import { CurateV2 } from "../typechain-types";
3+
import { registrationTemplate, removalTemplate, dataMappings } from "@kleros/curate-v2-templates";
4+
5+
// WARNING: The Devnet values are hardcoded!
6+
// It needs to be refactored like in the Escrow: https://github.com/kleros/escrow-v2/blob/master/contracts/scripts/setDisputeTemplate.ts
7+
8+
task("setDisputeTemplate", "Sets the dispute template").setAction(async (args, hre) => {
9+
const { ethers } = hre;
10+
const curate = (await ethers.getContract("CurateV2")) as CurateV2;
11+
await curate.changeRegistrationDisputeTemplate(registrationTemplate, dataMappings).then((tx) => tx.wait());
12+
await curate.changeRemovalDisputeTemplate(removalTemplate, dataMappings).then((tx) => tx.wait());
13+
});

templates/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// WARNING: The Devnet values are hardcoded,
2+
// It needs to be refactored like in the Escrow: https://github.com/kleros/escrow-v2/blob/master/contracts/scripts/setDisputeTemplate.ts
3+
14
const sharedTemplateProperties = `
25
"policyURI": "{{{policyURI}}}",
36
"frontendUrl": "https://curate-v2.kleros.builders/#/lists/item/{{itemID}}",

0 commit comments

Comments
 (0)