@@ -15,6 +15,7 @@ import {
1515 SortitionModuleNeo ,
1616 SortitionModuleUniversity ,
1717 TransactionBatcher ,
18+ KlerosCoreSnapshotProxy ,
1819} from "../../typechain-types" ;
1920
2021export const Cores = {
@@ -33,33 +34,34 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
3334 let disputeResolver : DisputeResolver ;
3435 switch ( coreType ) {
3536 case Cores . NEO :
36- core = ( await ethers . getContract ( "KlerosCoreNeo" ) ) as KlerosCoreNeo ;
37- sortition = ( await ethers . getContract ( "SortitionModuleNeo" ) ) as SortitionModuleNeo ;
38- disputeKitClassic = ( await ethers . getContract ( "DisputeKitClassicNeo" ) ) as DisputeKitClassic ;
39- disputeResolver = ( await ethers . getContract ( "DisputeResolverNeo" ) ) as DisputeResolver ;
37+ core = await ethers . getContract < KlerosCoreNeo > ( "KlerosCoreNeo" ) ;
38+ sortition = await ethers . getContract < SortitionModuleNeo > ( "SortitionModuleNeo" ) ;
39+ disputeKitClassic = await ethers . getContract < DisputeKitClassic > ( "DisputeKitClassicNeo" ) ;
40+ disputeResolver = await ethers . getContract < DisputeResolver > ( "DisputeResolverNeo" ) ;
4041 break ;
4142 case Cores . BASE :
42- core = ( await ethers . getContract ( "KlerosCore" ) ) as KlerosCore ;
43- sortition = ( await ethers . getContract ( "SortitionModule" ) ) as SortitionModule ;
44- disputeKitClassic = ( await ethers . getContract ( "DisputeKitClassic" ) ) as DisputeKitClassic ;
45- disputeResolver = ( await ethers . getContract ( "DisputeResolver" ) ) as DisputeResolver ;
43+ core = await ethers . getContract < KlerosCore > ( "KlerosCore" ) ;
44+ sortition = await ethers . getContract < SortitionModule > ( "SortitionModule" ) ;
45+ disputeKitClassic = await ethers . getContract < DisputeKitClassic > ( "DisputeKitClassic" ) ;
46+ disputeResolver = await ethers . getContract < DisputeResolver > ( "DisputeResolver" ) ;
4647 break ;
4748 case Cores . UNIVERSITY :
48- core = ( await ethers . getContract ( "KlerosCoreUniversity" ) ) as KlerosCoreUniversity ;
49- sortition = ( await ethers . getContract ( "SortitionModuleUniversity" ) ) as SortitionModuleUniversity ;
50- disputeKitClassic = ( await ethers . getContract ( "DisputeKitClassicUniversity" ) ) as DisputeKitClassic ;
51- disputeResolver = ( await ethers . getContract ( "DisputeResolverUniversity" ) ) as DisputeResolver ;
49+ core = await ethers . getContract < KlerosCoreUniversity > ( "KlerosCoreUniversity" ) ;
50+ sortition = await ethers . getContract < SortitionModuleUniversity > ( "SortitionModuleUniversity" ) ;
51+ disputeKitClassic = await ethers . getContract < DisputeKitClassic > ( "DisputeKitClassicUniversity" ) ;
52+ disputeResolver = await ethers . getContract < DisputeResolver > ( "DisputeResolverUniversity" ) ;
5253 break ;
5354 default :
5455 throw new Error ( "Invalid core type, must be one of BASE, NEO, or UNIVERSITY" ) ;
5556 }
56- const disputeTemplateRegistry = ( await ethers . getContract ( "DisputeTemplateRegistry" ) ) as DisputeTemplateRegistry ;
57- const policyRegistry = ( await ethers . getContract ( "PolicyRegistry" ) ) as PolicyRegistry ;
58- const batcher = ( await ethers . getContract ( "TransactionBatcher" ) ) as TransactionBatcher ;
57+ const disputeTemplateRegistry = await ethers . getContract < DisputeTemplateRegistry > ( "DisputeTemplateRegistry" ) ;
58+ const policyRegistry = await ethers . getContract < PolicyRegistry > ( "PolicyRegistry" ) ;
59+ const batcher = await ethers . getContract < TransactionBatcher > ( "TransactionBatcher" ) ;
5960 const chainlinkRng = await ethers . getContractOrNull < ChainlinkRNG > ( "ChainlinkRNG" ) ;
6061 const randomizerRng = await ethers . getContractOrNull < RandomizerRNG > ( "RandomizerRNG" ) ;
6162 const blockHashRNG = await ethers . getContractOrNull < BlockHashRNG > ( "BlockHashRNG" ) ;
62- const pnk = ( await ethers . getContract ( "PNK" ) ) as PNK ;
63+ const pnk = await ethers . getContract < PNK > ( "PNK" ) ;
64+ const snapshotProxy = await ethers . getContractOrNull < KlerosCoreSnapshotProxy > ( "KlerosCoreSnapshotProxy" ) ;
6365 return {
6466 core,
6567 sortition,
@@ -72,5 +74,6 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
7274 blockHashRNG,
7375 pnk,
7476 batcher,
77+ snapshotProxy,
7578 } ;
7679} ;
0 commit comments