Skip to content

Commit

Permalink
chore: deploy script fixes and artifacts for PNK
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Dec 19, 2023
1 parent 51f889d commit ddee869
Show file tree
Hide file tree
Showing 20 changed files with 1,288 additions and 137 deletions.
1 change: 0 additions & 1 deletion contracts/deploy/00-ethereum-pnk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json";
import { isSkipped } from "./utils";

enum Chains {
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/00-home-chain-arbitration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { BigNumber } from "ethers";
import getContractAddress from "./utils/getContractAddress";
import { getContractAddress } from "./utils/getContractAddress";
import { deployUpgradable } from "./utils/deployUpgradable";
import { HomeChains, isSkipped, isDevnet } from "./utils";

Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/01-foreign-gateway-on-ethereum.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import getContractAddress from "./utils/getContractAddress";
import { getContractAddress } from "./utils/getContractAddress";
import { KlerosCore__factory } from "../typechain-types";
import { Courts, ForeignChains, isSkipped } from "./utils";
import { deployUpgradable } from "./utils/deployUpgradable";
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/01-foreign-gateway-on-gnosis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parseUnits } from "ethers/lib/utils";
import { HardhatRuntimeEnvironment, HttpNetworkConfig } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import getContractAddress from "./utils/getContractAddress";
import { getContractAddress } from "./utils/getContractAddress";
import { KlerosCore__factory } from "../typechain-types";
import { Courts, ForeignChains, isSkipped } from "./utils";
import { deployUpgradable } from "./utils/deployUpgradable";
Expand Down
2 changes: 1 addition & 1 deletion contracts/deploy/03-vea-mock.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import getContractAddress from "./utils/getContractAddress";
import { getContractAddress } from "./utils/getContractAddress";
import { KlerosCore__factory } from "../typechain-types";
import disputeTemplate from "../test/fixtures/DisputeTemplate.simple.json";
import { Courts, HardhatChain, isSkipped } from "./utils";
Expand Down
12 changes: 3 additions & 9 deletions contracts/deploy/fix1148.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { DisputeKitClassic, KlerosCore, SortitionModule } from "../typechain-types";
import assert from "node:assert";
import { isSkipped } from "./utils";

enum HomeChains {
ARBITRUM_ONE = 42161,
ARBITRUM_SEPOLIA = 421614,
HARDHAT = 31337,
}
import { HomeChains, isSkipped } from "./utils";

const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
Expand Down Expand Up @@ -38,11 +32,11 @@ const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment)
const newDisputeKitId = 2;

assert(
await klerosCore.disputeKitNodes(oldDisputeKitId).then((node) => node.disputeKit === oldDisputeKit.address),
await klerosCore.disputeKits(oldDisputeKitId).then((dk) => dk === oldDisputeKit.address),
`wrong dispute kit id ${oldDisputeKitId}`
);
assert(
await klerosCore.disputeKitNodes(newDisputeKitId).then((node) => node.disputeKit === newDisputeKit.address),
await klerosCore.disputeKits(newDisputeKitId).then((dk) => dk === newDisputeKit.address),
`wrong dispute kit id ${newDisputeKitId}`
);

Expand Down
8 changes: 1 addition & 7 deletions contracts/deploy/upgrade-kleros-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { BigNumber } from "ethers";
import { deployUpgradable } from "./utils/deployUpgradable";
import { isSkipped } from "./utils";

enum HomeChains {
ARBITRUM_ONE = 42161,
ARBITRUM_SEPOLIA = 421614,
HARDHAT = 31337,
}
import { HomeChains, isSkipped } from "./utils";

const deployUpgradeKlerosCore: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
Expand Down
8 changes: 1 addition & 7 deletions contracts/deploy/upgrade-sortition-module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deployUpgradable } from "./utils/deployUpgradable";
import { isSkipped } from "./utils";

enum HomeChains {
ARBITRUM_ONE = 42161,
ARBITRUM_SEPOLIA = 421614,
HARDHAT = 31337,
}
import { HomeChains, isSkipped } from "./utils";

const deployUpgradeSortitionModule: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts, getChainId } = hre;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ const { BN, Address, toChecksumAddress } = require("ethereumjs-util");
* @param {number|BN} nonce The current nonce for the deployer account.
* @return {string} The address of a contract if it is deployed in the next transaction sent by the deployer account.
*/
function getContractAddress(deployer, nonce) {
export const getContractAddress = (deployer, nonce) => {
const deployAddress = Address.generate(Address.fromString(deployer), new BN(String(nonce)));
return toChecksumAddress(deployAddress.toString());
}

module.exports = getContractAddress;
};
1 change: 1 addition & 0 deletions contracts/deployments/arbitrumSepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
421614
280 changes: 280 additions & 0 deletions contracts/deployments/arbitrumSepolia/PNK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
{
"address": "0x34B944D42cAcfC8266955D07A80181D2054aa225",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "addedValue",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
1 change: 1 addition & 0 deletions contracts/deployments/arbitrumSepolia/PinakionV2.json
1 change: 1 addition & 0 deletions contracts/deployments/arbitrumSepoliaDevnet/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
421614
Loading

0 comments on commit ddee869

Please sign in to comment.