1- import { DisputeKitClassic , KlerosCore , PNK , RandomizerRNG , BlockHashRNG , SortitionModule } from "../typechain-types" ;
1+ import {
2+ DisputeKitClassic ,
3+ KlerosCore ,
4+ PNK ,
5+ RandomizerRNG ,
6+ BlockHashRNG ,
7+ SortitionModule ,
8+ KlerosCoreNeo ,
9+ KlerosCoreUniversity ,
10+ } from "../typechain-types" ;
211import request from "graphql-request" ;
312import env from "./utils/env" ;
413import loggerFactory from "./utils/logger" ;
@@ -15,6 +24,7 @@ const HIGH_GAS_LIMIT = { gasLimit: 50_000_000 }; // 50M gas
1524const HEARTBEAT_URL = env . optionalNoDefault ( "HEARTBEAT_URL_KEEPER_BOT" ) ;
1625const SUBGRAPH_URL = env . require ( "SUBGRAPH_URL" ) ;
1726const MAX_JURORS_PER_DISPUTE = 1000 ; // Skip disputes with more than this number of jurors
27+ const CORE_TYPE = env . optional ( "CORE_TYPE" , "base" ) ;
1828const DISPUTES_TO_SKIP = env
1929 . optional ( "DISPUTES_TO_SKIP" , "" )
2030 . split ( "," )
@@ -33,7 +43,21 @@ const loggerOptions = env.optionalNoDefault("LOGTAIL_TOKEN_KEEPER_BOT")
3343const logger = loggerFactory . createLogger ( loggerOptions ) ;
3444
3545const getContracts = async ( ) => {
36- const core = ( await ethers . getContract ( "KlerosCore" ) ) as KlerosCore ;
46+ let core : KlerosCore | KlerosCoreNeo | KlerosCoreUniversity ;
47+ const coreType = Cores [ CORE_TYPE . toUpperCase ( ) as keyof typeof Cores ] ;
48+ switch ( coreType ) {
49+ case Cores . UNIVERSITY :
50+ core = ( await ethers . getContract ( "KlerosCoreUniversity" ) ) as KlerosCoreUniversity ;
51+ break ;
52+ case Cores . NEO :
53+ core = ( await ethers . getContract ( "KlerosCoreNeo" ) ) as KlerosCoreNeo ;
54+ break ;
55+ case Cores . BASE :
56+ core = ( await ethers . getContract ( "KlerosCore" ) ) as KlerosCore ;
57+ break ;
58+ default :
59+ throw new Error ( "Invalid core type, must be one of base, neo, university" ) ;
60+ }
3761 const sortition = ( await ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
3862 const randomizerRng = ( await ethers . getContract ( "RandomizerRNG" ) ) as RandomizerRNG ;
3963 const blockHashRNG = ( await ethers . getContract ( "BlockHashRNG" ) ) as BlockHashRNG ;
@@ -67,6 +91,12 @@ type CustomError = {
6791 errorSignature : string ;
6892} ;
6993
94+ enum Cores {
95+ BASE ,
96+ NEO ,
97+ UNIVERSITY ,
98+ }
99+
70100enum Phase {
71101 STAKING = "staking" ,
72102 GENERATING = "generating" ,
0 commit comments