Skip to content

Commit ddee869

Browse files
committed
chore: deploy script fixes and artifacts for PNK
1 parent 51f889d commit ddee869

20 files changed

+1288
-137
lines changed

contracts/deploy/00-ethereum-pnk.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json";
43
import { isSkipped } from "./utils";
54

65
enum Chains {

contracts/deploy/00-home-chain-arbitration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { BigNumber } from "ethers";
4-
import getContractAddress from "./utils/getContractAddress";
4+
import { getContractAddress } from "./utils/getContractAddress";
55
import { deployUpgradable } from "./utils/deployUpgradable";
66
import { HomeChains, isSkipped, isDevnet } from "./utils";
77

contracts/deploy/01-foreign-gateway-on-ethereum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import getContractAddress from "./utils/getContractAddress";
3+
import { getContractAddress } from "./utils/getContractAddress";
44
import { KlerosCore__factory } from "../typechain-types";
55
import { Courts, ForeignChains, isSkipped } from "./utils";
66
import { deployUpgradable } from "./utils/deployUpgradable";

contracts/deploy/01-foreign-gateway-on-gnosis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { parseUnits } from "ethers/lib/utils";
22
import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types";
33
import { DeployFunction } from "hardhat-deploy/types";
4-
import getContractAddress from "./utils/getContractAddress";
4+
import { getContractAddress } from "./utils/getContractAddress";
55
import { KlerosCore__factory } from "../typechain-types";
66
import { Courts, ForeignChains, isSkipped } from "./utils";
77
import { deployUpgradable } from "./utils/deployUpgradable";

contracts/deploy/03-vea-mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
3-
import getContractAddress from "./utils/getContractAddress";
3+
import { getContractAddress } from "./utils/getContractAddress";
44
import { KlerosCore__factory } from "../typechain-types";
55
import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json";
66
import { Courts, HardhatChain, isSkipped } from "./utils";

contracts/deploy/fix1148.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { DisputeKitClassic, KlerosCore, SortitionModule } from "../typechain-types";
44
import assert from "node:assert";
5-
import { isSkipped } from "./utils";
6-
7-
enum HomeChains {
8-
ARBITRUM_ONE = 42161,
9-
ARBITRUM_SEPOLIA = 421614,
10-
HARDHAT = 31337,
11-
}
5+
import { HomeChains, isSkipped } from "./utils";
126

137
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
148
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
@@ -38,11 +32,11 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
3832
const newDisputeKitId = 2;
3933

4034
assert(
41-
await klerosCore.disputeKitNodes(oldDisputeKitId).then((node) => node.disputeKit === oldDisputeKit.address),
35+
await klerosCore.disputeKits(oldDisputeKitId).then((dk) => dk === oldDisputeKit.address),
4236
`wrong dispute kit id ${oldDisputeKitId}`
4337
);
4438
assert(
45-
await klerosCore.disputeKitNodes(newDisputeKitId).then((node) => node.disputeKit === newDisputeKit.address),
39+
await klerosCore.disputeKits(newDisputeKitId).then((dk) => dk === newDisputeKit.address),
4640
`wrong dispute kit id ${newDisputeKitId}`
4741
);
4842

contracts/deploy/upgrade-kleros-core.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { BigNumber } from "ethers";
44
import { deployUpgradable } from "./utils/deployUpgradable";
5-
import { isSkipped } from "./utils";
6-
7-
enum HomeChains {
8-
ARBITRUM_ONE = 42161,
9-
ARBITRUM_SEPOLIA = 421614,
10-
HARDHAT = 31337,
11-
}
5+
import { HomeChains, isSkipped } from "./utils";
126

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

contracts/deploy/upgrade-sortition-module.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { HardhatRuntimeEnvironment } from "hardhat/types";
22
import { DeployFunction } from "hardhat-deploy/types";
33
import { deployUpgradable } from "./utils/deployUpgradable";
4-
import { isSkipped } from "./utils";
5-
6-
enum HomeChains {
7-
ARBITRUM_ONE = 42161,
8-
ARBITRUM_SEPOLIA = 421614,
9-
HARDHAT = 31337,
10-
}
4+
import { HomeChains, isSkipped } from "./utils";
115

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

contracts/deploy/utils/getContractAddress.js renamed to contracts/deploy/utils/getContractAddress.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ const { BN, Address, toChecksumAddress } = require("ethereumjs-util");
66
* @param {number|BN} nonce The current nonce for the deployer account.
77
* @return {string} The address of a contract if it is deployed in the next transaction sent by the deployer account.
88
*/
9-
function getContractAddress(deployer, nonce) {
9+
export const getContractAddress = (deployer, nonce) => {
1010
const deployAddress = Address.generate(Address.fromString(deployer), new BN(String(nonce)));
1111
return toChecksumAddress(deployAddress.toString());
12-
}
13-
14-
module.exports = getContractAddress;
12+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
421614

0 commit comments

Comments
 (0)