Skip to content

Commit a61e521

Browse files
committed
chore: removed traces of Neo in more scripts
1 parent 923bd7b commit a61e521

File tree

6 files changed

+31
-55
lines changed

6 files changed

+31
-55
lines changed

contracts/scripts/changeOwner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { bold } = print.colors;
77

88
task("change-owner", "Changes the owner for all the contracts")
99
.addPositionalParam("newOwner", "The address of the new owner")
10-
.addOptionalParam("coreType", "The type of core to use between base, neo, university (default: base)", Cores.BASE)
10+
.addOptionalParam("coreType", "The type of core to use between base, university (default: base)", Cores.BASE)
1111
.setAction(async (taskArgs, hre) => {
1212
const newOwner = taskArgs.newOwner;
1313
if (!isAddress(newOwner)) {
@@ -27,7 +27,7 @@ task("change-owner", "Changes the owner for all the contracts")
2727

2828
const coreType = Cores[taskArgs.coreType.toUpperCase() as keyof typeof Cores];
2929
if (coreType === undefined) {
30-
console.error("Invalid core type, must be one of base, neo, university");
30+
console.error("Invalid core type, must be one of base, university");
3131
return;
3232
}
3333
console.log("Using core type %s", coreType);

contracts/scripts/keeperBot.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
DisputeKitGatedShutter,
77
DisputeKitShutter,
88
SortitionModule,
9-
SortitionModuleNeo,
109
} from "../typechain-types";
1110
import env from "./utils/env";
1211
import loggerFactory from "./utils/logger";
@@ -49,7 +48,7 @@ const getContracts = async () => {
4948
throw new Error("University is not supported yet");
5049
}
5150
const contracts = await getContractsForCoreType(hre, coreType);
52-
return { ...contracts, sortition: contracts.sortition as SortitionModule | SortitionModuleNeo };
51+
return { ...contracts, sortition: contracts.sortition as SortitionModule };
5352
};
5453

5554
type Contribution = {
@@ -277,9 +276,7 @@ const isRngReady = async () => {
277276
return true;
278277
}
279278
} else if (currentRng === blockHashRNG?.target && blockHashRNG !== null) {
280-
const requestBlock = await sortition.randomNumberRequestBlock();
281-
const lookahead = await sortition.rngLookahead();
282-
const n = await blockHashRNG.receiveRandomness.staticCall(requestBlock + lookahead);
279+
const n = await blockHashRNG.receiveRandomness.staticCall();
283280
if (Number(n) === 0) {
284281
logger.info("BlockHashRNG is NOT ready yet");
285282
return false;

contracts/scripts/keeperBotShutter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import hre from "hardhat";
22
import { getBytes } from "ethers";
3-
import { DisputeKitGatedShutter, DisputeKitShutter, SortitionModule, SortitionModuleNeo } from "../typechain-types";
3+
import { DisputeKitGatedShutter, DisputeKitShutter } from "../typechain-types";
44
import { decrypt } from "./shutter";
55
import env from "./utils/env";
66
import loggerFactory from "./utils/logger";
@@ -312,8 +312,7 @@ const getContracts = async () => {
312312
if (coreType === Cores.UNIVERSITY) {
313313
throw new Error("University is not supported yet");
314314
}
315-
const contracts = await getContractsForCoreType(hre, coreType);
316-
return { ...contracts, sortition: contracts.sortition as SortitionModule | SortitionModuleNeo };
315+
return await getContractsForCoreType(hre, coreType);
317316
};
318317

319318
async function main() {

contracts/scripts/populateCourts.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { task, types } from "hardhat/config";
2-
import { KlerosCore, KlerosCoreNeo, KlerosCoreUniversity } from "../typechain-types";
2+
import { KlerosCore, KlerosCoreUniversity } from "../typechain-types";
33
import { BigNumberish, toBigInt, toNumber } from "ethers";
44
import courtsV1Mainnet from "../config/courts.v1.mainnet.json";
55
import courtsV1GnosisChain from "../config/courts.v1.gnosischain.json";
66
import courtsV2ArbitrumTestnet from "../config/courts.v2.testnet.json";
77
import courtsV2ArbitrumDevnet from "../config/courts.v2.devnet.json";
8-
import courtsV2MainnetNeo from "../config/courts.v2.mainnet-neo.json";
8+
import courtsV2Mainnet from "../config/courts.v2.mainnet.json";
99
import { isDevnet } from "../deploy/utils";
1010
import { execute, writeTransactionBatch } from "./utils/execution";
1111
import { getContracts, Cores } from "./utils/contracts";
@@ -21,7 +21,7 @@ enum Sources {
2121
V1_GNOSIS,
2222
V2_DEVNET,
2323
V2_TESTNET,
24-
V2_MAINNET_NEO,
24+
V2_MAINNET,
2525
}
2626

2727
type Court = {
@@ -43,7 +43,7 @@ const TEN_THOUSAND_GWEI = 10n ** 13n;
4343
task("populate:courts", "Populates the courts and their parameters")
4444
.addOptionalParam(
4545
"from",
46-
"The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet_neo (default: auto depending on the network)",
46+
"The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet (default: auto depending on the network)",
4747
undefined
4848
)
4949
.addOptionalParam("start", "The starting index for the courts to populate (default: 0)", 0, types.int)
@@ -53,7 +53,7 @@ task("populate:courts", "Populates the courts and their parameters")
5353
undefined,
5454
types.int
5555
)
56-
.addOptionalParam("coreType", "The type of core to use between base, neo, university (default: base)", Cores.BASE)
56+
.addOptionalParam("coreType", "The type of core to use between base, university (default: base)", Cores.BASE)
5757
.addFlag("reverse", "Iterates the courts in reverse order, useful to increase minStake in the child courts first")
5858
.addFlag("forceV1ParametersToDev", "Use development values for the v1 courts parameters")
5959
.setAction(async (taskArgs, hre) => {
@@ -74,7 +74,7 @@ task("populate:courts", "Populates the courts and their parameters")
7474
if (taskArgs.from) {
7575
from = Sources[taskArgs.from.toUpperCase() as keyof typeof Sources];
7676
if (from === undefined) {
77-
console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet_neo");
77+
console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet");
7878
return;
7979
}
8080
} else {
@@ -84,7 +84,7 @@ task("populate:courts", "Populates the courts and their parameters")
8484

8585
const coreType = Cores[taskArgs.coreType.toUpperCase() as keyof typeof Cores];
8686
if (coreType === undefined) {
87-
console.error("Invalid core type, must be one of base, neo, university");
87+
console.error("Invalid core type, must be one of base, university");
8888
return;
8989
}
9090
console.log("Using core type %s", coreType);
@@ -133,8 +133,8 @@ task("populate:courts", "Populates the courts and their parameters")
133133
courtsV2 = courtsV2ArbitrumTestnet;
134134
break;
135135
}
136-
case Sources.V2_MAINNET_NEO: {
137-
courtsV2 = courtsV2MainnetNeo;
136+
case Sources.V2_MAINNET: {
137+
courtsV2 = courtsV2Mainnet;
138138
break;
139139
}
140140
default:

contracts/scripts/populatePolicyRegistry.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import policiesV1Mainnet from "../config/policies.v1.mainnet.json";
44
import policiesV1GnosisChain from "../config/policies.v1.gnosischain.json";
55
import policiesV2ArbitrumTestnet from "../config/policies.v2.testnet.json";
66
import policiesV2ArbitrumDevnet from "../config/policies.v2.devnet.json";
7-
import policiesV2MainnetNeo from "../config/policies.v2.mainnet-neo.json";
7+
import policiesV2Mainnet from "../config/policies.v2.mainnet.json";
88
import { isDevnet } from "../deploy/utils";
99
import { execute, writeTransactionBatch } from "./utils/execution";
1010

@@ -19,13 +19,13 @@ enum Sources {
1919
V1_GNOSIS,
2020
V2_DEVNET,
2121
V2_TESTNET,
22-
V2_MAINNET_NEO,
22+
V2_MAINNET,
2323
}
2424

2525
task("populate:policy-registry", "Populates the policy registry for each court")
2626
.addOptionalParam(
2727
"from",
28-
"The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet_neo (default: auto depending on the network)",
28+
"The source of the policies between v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet (default: auto depending on the network)",
2929
undefined
3030
)
3131
.addOptionalParam("start", "The starting index for the courts to populate (default: 0)", 0, types.int)
@@ -53,7 +53,7 @@ task("populate:policy-registry", "Populates the policy registry for each court")
5353
if (taskArgs.from) {
5454
from = Sources[taskArgs.from.toUpperCase() as keyof typeof Sources];
5555
if (from === undefined) {
56-
console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet_neo");
56+
console.error("Invalid source, must be one of v1_mainnet, v1_gnosis, v2_devnet, v2_testnet, v2_mainnet");
5757
return;
5858
}
5959
} else {
@@ -88,8 +88,8 @@ task("populate:policy-registry", "Populates the policy registry for each court")
8888
policiesV2 = policiesV2ArbitrumTestnet;
8989
break;
9090
}
91-
case Sources.V2_MAINNET_NEO: {
92-
policiesV2 = policiesV2MainnetNeo;
91+
case Sources.V2_MAINNET: {
92+
policiesV2 = policiesV2Mainnet;
9393
break;
9494
}
9595
default:

contracts/scripts/utils/contracts.ts

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import {
77
DisputeResolver,
88
DisputeTemplateRegistry,
99
KlerosCore,
10-
KlerosCoreNeo,
1110
KlerosCoreUniversity,
1211
PNK,
1312
PolicyRegistry,
1413
RandomizerRNG,
1514
SortitionModule,
16-
SortitionModuleNeo,
1715
SortitionModuleUniversity,
1816
TransactionBatcher,
1917
KlerosCoreSnapshotProxy,
@@ -24,28 +22,18 @@ import {
2422

2523
export const Cores = {
2624
BASE: "BASE",
27-
NEO: "NEO",
2825
UNIVERSITY: "UNIVERSITY",
2926
} as const;
3027

3128
export type Core = (typeof Cores)[keyof typeof Cores];
3229

3330
/**
34-
* Get contract names by specifying the coreType (BASE, NEO, UNIVERSITY).
31+
* Get contract names by specifying the coreType (BASE, UNIVERSITY).
3532
* @param coreType - Core type
3633
* @returns Contract names
3734
*/
3835
export const getContractNames = (coreType: Core) => {
3936
const coreSpecificNames = {
40-
[Cores.NEO]: {
41-
core: "KlerosCoreNeo",
42-
sortition: "SortitionModuleNeo",
43-
disputeKitClassic: "DisputeKitClassicNeo",
44-
disputeKitShutter: "DisputeKitShutterNeo",
45-
disputeKitGated: "DisputeKitGatedNeo",
46-
disputeKitGatedShutter: "DisputeKitGatedShutterNeo",
47-
disputeResolver: "DisputeResolverNeo",
48-
},
4937
[Cores.BASE]: {
5038
core: "KlerosCore",
5139
sortition: "SortitionModule",
@@ -66,7 +54,7 @@ export const getContractNames = (coreType: Core) => {
6654
},
6755
};
6856

69-
if (!(coreType in coreSpecificNames)) throw new Error("Invalid core type, must be one of BASE, NEO, or UNIVERSITY");
57+
if (!(coreType in coreSpecificNames)) throw new Error("Invalid core type, must be one of BASE, or UNIVERSITY");
7058

7159
return {
7260
...coreSpecificNames[coreType],
@@ -83,20 +71,16 @@ export const getContractNames = (coreType: Core) => {
8371
};
8472

8573
/**
86-
* Get contracts by specifying the coreType (BASE, NEO, UNIVERSITY).
74+
* Get contracts by specifying the coreType (BASE, UNIVERSITY).
8775
* @param hre - Hardhat runtime environment
8876
* @param coreType - Core type
8977
* @returns Contracts
9078
*/
9179
export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Core) => {
9280
const { ethers } = hre;
93-
let core: KlerosCore | KlerosCoreNeo | KlerosCoreUniversity;
94-
let sortition: SortitionModule | SortitionModuleNeo | SortitionModuleUniversity;
81+
let core: KlerosCore | KlerosCoreUniversity;
82+
let sortition: SortitionModule | SortitionModuleUniversity;
9583
switch (coreType) {
96-
case Cores.NEO:
97-
core = await ethers.getContract<KlerosCoreNeo>(getContractNames(coreType).core);
98-
sortition = await ethers.getContract<SortitionModuleNeo>(getContractNames(coreType).sortition);
99-
break;
10084
case Cores.BASE:
10185
core = await ethers.getContract<KlerosCore>(getContractNames(coreType).core);
10286
sortition = await ethers.getContract<SortitionModule>(getContractNames(coreType).sortition);
@@ -106,7 +90,7 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
10690
sortition = await ethers.getContract<SortitionModuleUniversity>(getContractNames(coreType).sortition);
10791
break;
10892
default:
109-
throw new Error("Invalid core type, must be one of BASE, NEO, or UNIVERSITY");
93+
throw new Error("Invalid core type, must be one of BASE, or UNIVERSITY");
11094
}
11195
const disputeKitClassic = await ethers.getContract<DisputeKitClassic>(getContractNames(coreType).disputeKitClassic);
11296
const disputeKitShutter = await ethers.getContractOrNull<DisputeKitShutter>(
@@ -151,32 +135,28 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
151135
};
152136

153137
/**
154-
* Get contracts by inferring the coreType (BASE, NEO, UNIVERSITY) from the network, most convenient for most cases.
138+
* Get contracts by inferring the coreType (BASE, UNIVERSITY) from the network, most convenient for most cases.
155139
* @param hre - Hardhat runtime environment
156140
* @returns Contracts
157141
*/
158142
export const getContractsFromNetwork = async (hre: HardhatRuntimeEnvironment) => {
159143
const { network } = hre;
160-
if (network.name === "arbitrumSepoliaDevnet" || network.name === "arbitrumSepolia") {
144+
if (["arbitrumSepoliaDevnet", "arbitrumSepolia", "arbitrum"].includes(network.name)) {
161145
return getContracts(hre, Cores.BASE);
162-
} else if (network.name === "arbitrum") {
163-
return getContracts(hre, Cores.NEO);
164146
} else {
165147
throw new Error("Invalid network");
166148
}
167149
};
168150

169151
/**
170-
* Get contract names by inferring the coreType (BASE, NEO, UNIVERSITY) from the network, most convenient for most cases.
152+
* Get contract names by inferring the coreType (BASE, UNIVERSITY) from the network, most convenient for most cases.
171153
* @param hre - Hardhat runtime environment
172154
* @returns Contract names
173155
*/
174156
export const getContractNamesFromNetwork = async (hre: HardhatRuntimeEnvironment) => {
175157
const { network } = hre;
176-
if (network.name === "arbitrumSepoliaDevnet" || network.name === "arbitrumSepolia") {
158+
if (["arbitrumSepoliaDevnet", "arbitrumSepolia", "arbitrum"].includes(network.name)) {
177159
return getContractNames(Cores.BASE);
178-
} else if (network.name === "arbitrum") {
179-
return getContractNames(Cores.NEO);
180160
} else {
181161
throw new Error("Invalid network");
182162
}

0 commit comments

Comments
 (0)