@@ -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
2523export const Cores = {
2624 BASE : "BASE" ,
27- NEO : "NEO" ,
2825 UNIVERSITY : "UNIVERSITY" ,
2926} as const ;
3027
3128export 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 */
3835export 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 */
9179export 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 */
158142export 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 */
174156export 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