@@ -15,6 +15,7 @@ import {
15
15
SortitionModuleNeo ,
16
16
SortitionModuleUniversity ,
17
17
TransactionBatcher ,
18
+ KlerosCoreSnapshotProxy ,
18
19
} from "../../typechain-types" ;
19
20
20
21
export const Cores = {
@@ -33,33 +34,34 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
33
34
let disputeResolver : DisputeResolver ;
34
35
switch ( coreType ) {
35
36
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" ) ;
40
41
break ;
41
42
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" ) ;
46
47
break ;
47
48
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" ) ;
52
53
break ;
53
54
default :
54
55
throw new Error ( "Invalid core type, must be one of BASE, NEO, or UNIVERSITY" ) ;
55
56
}
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" ) ;
59
60
const chainlinkRng = await ethers . getContractOrNull < ChainlinkRNG > ( "ChainlinkRNG" ) ;
60
61
const randomizerRng = await ethers . getContractOrNull < RandomizerRNG > ( "RandomizerRNG" ) ;
61
62
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" ) ;
63
65
return {
64
66
core,
65
67
sortition,
@@ -72,5 +74,6 @@ export const getContracts = async (hre: HardhatRuntimeEnvironment, coreType: Cor
72
74
blockHashRNG,
73
75
pnk,
74
76
batcher,
77
+ snapshotProxy,
75
78
} ;
76
79
} ;
0 commit comments