@@ -20,6 +20,9 @@ import {
2020 BlockHashRNG__factory ,
2121 PNK__factory ,
2222 KlerosCoreSnapshotProxy__factory ,
23+ DisputeKitShutter__factory ,
24+ DisputeKitGated__factory ,
25+ DisputeKitGatedShutter__factory ,
2326} from "../../typechain-types" ;
2427import { getActualAddress } from "../utils/getActualAddress" ;
2528
@@ -39,10 +42,32 @@ type ContractMapping = {
3942 } ;
4043} ;
4144
42- const baseContractMapping : ContractMapping = {
45+ const devnetContractMapping : ContractMapping = {
4346 klerosCore : { name : "KlerosCore" } ,
4447 sortition : { name : "SortitionModule" } ,
4548 disputeKitClassic : { name : "DisputeKitClassic" } ,
49+ disputeKitShutter : { name : "DisputeKitShutter" } ,
50+ disputeKitGated : { name : "DisputeKitGated" } ,
51+ disputeKitGatedShutter : { name : "DisputeKitGatedShutter" } ,
52+ disputeResolver : { name : "DisputeResolver" } ,
53+ disputeTemplateRegistry : { name : "DisputeTemplateRegistry" } ,
54+ evidence : { name : "EvidenceModule" } ,
55+ policyRegistry : { name : "PolicyRegistry" } ,
56+ transactionBatcher : { name : "TransactionBatcher" } ,
57+ chainlinkRng : { name : "ChainlinkRNG" , optional : true } ,
58+ randomizerRng : { name : "RandomizerRNG" , optional : true } ,
59+ blockHashRng : { name : "BlockHashRNG" } ,
60+ pnk : { name : "PNK" } ,
61+ klerosCoreSnapshotProxy : { name : "KlerosCoreSnapshotProxy" } ,
62+ } ;
63+
64+ const testnetContractMapping : ContractMapping = {
65+ klerosCore : { name : "KlerosCore" } ,
66+ sortition : { name : "SortitionModule" } ,
67+ disputeKitClassic : { name : "DisputeKitClassic" } ,
68+ disputeKitShutter : { name : "DisputeKitShutter" , optional : true } ,
69+ disputeKitGated : { name : "DisputeKitGated" , optional : true } ,
70+ disputeKitGatedShutter : { name : "DisputeKitGatedShutter" , optional : true } ,
4671 disputeResolver : { name : "DisputeResolver" } ,
4772 disputeTemplateRegistry : { name : "DisputeTemplateRegistry" } ,
4873 evidence : { name : "EvidenceModule" } ,
@@ -59,6 +84,9 @@ const universityContractMapping: ContractMapping = {
5984 klerosCore : { name : "KlerosCoreUniversity" } ,
6085 sortition : { name : "SortitionModuleUniversity" } ,
6186 disputeKitClassic : { name : "DisputeKitClassicUniversity" } ,
87+ disputeKitShutter : { name : "DisputeKitShutterUniversity" , optional : true } ,
88+ disputeKitGated : { name : "DisputeKitGatedUniversity" , optional : true } ,
89+ disputeKitGatedShutter : { name : "DisputeKitGatedShutterUniversity" , optional : true } ,
6290 disputeResolver : { name : "DisputeResolverUniversity" } ,
6391 disputeTemplateRegistry : { name : "DisputeTemplateRegistry" } ,
6492 evidence : { name : "EvidenceModule" } ,
@@ -75,6 +103,9 @@ const neoContractMapping: ContractMapping = {
75103 klerosCore : { name : "KlerosCoreNeo" } ,
76104 sortition : { name : "SortitionModuleNeo" } ,
77105 disputeKitClassic : { name : "DisputeKitClassicNeo" } ,
106+ disputeKitShutter : { name : "DisputeKitShutterNeo" , optional : true } ,
107+ disputeKitGated : { name : "DisputeKitGatedNeo" , optional : true } ,
108+ disputeKitGatedShutter : { name : "DisputeKitGatedShutterNeo" , optional : true } ,
78109 disputeResolver : { name : "DisputeResolverNeo" } ,
79110 disputeTemplateRegistry : { name : "DisputeTemplateRegistry" } ,
80111 evidence : { name : "EvidenceModule" } ,
@@ -87,7 +118,7 @@ const neoContractMapping: ContractMapping = {
87118 klerosCoreSnapshotProxy : { name : "KlerosCoreSnapshotProxy" } ,
88119} ;
89120
90- describe ( "getContractsEthers" , ( ) => {
121+ describe ( "getContractsEthers" , async ( ) => {
91122 // Use real providers for each network
92123 const arbitrumSepoliaProvider = new ethers . JsonRpcProvider ( "https://sepolia-rollup.arbitrum.io/rpc" ) ;
93124 const arbitrumProvider = new ethers . JsonRpcProvider ( "https://arb1.arbitrum.io/rpc" ) ;
@@ -104,6 +135,17 @@ describe("getContractsEthers", () => {
104135 provider : ethers . Provider
105136 ) {
106137 expect ( contracts . disputeKitClassic ) . to . be . instanceOf ( getConstructor ( DisputeKitClassic__factory , provider ) ) ;
138+ if ( contracts . disputeKitShutter ) {
139+ expect ( contracts . disputeKitShutter ) . to . be . instanceOf ( getConstructor ( DisputeKitShutter__factory , provider ) ) ;
140+ }
141+ if ( contracts . disputeKitGated ) {
142+ expect ( contracts . disputeKitGated ) . to . be . instanceOf ( getConstructor ( DisputeKitGated__factory , provider ) ) ;
143+ }
144+ if ( contracts . disputeKitGatedShutter ) {
145+ expect ( contracts . disputeKitGatedShutter ) . to . be . instanceOf (
146+ getConstructor ( DisputeKitGatedShutter__factory , provider )
147+ ) ;
148+ }
107149 expect ( contracts . disputeResolver ) . to . be . instanceOf ( getConstructor ( DisputeResolver__factory , provider ) ) ;
108150 expect ( contracts . disputeTemplateRegistry ) . to . be . instanceOf (
109151 getConstructor ( DisputeTemplateRegistry__factory , provider )
@@ -136,6 +178,15 @@ describe("getContractsEthers", () => {
136178 await verifyContractAddress ( contracts . klerosCore . getAddress ( ) ) ;
137179 await verifyContractAddress ( contracts . sortition . getAddress ( ) ) ;
138180 await verifyContractAddress ( contracts . disputeKitClassic . getAddress ( ) ) ;
181+ if ( contracts . disputeKitShutter ) {
182+ await verifyContractAddress ( contracts . disputeKitShutter . getAddress ( ) ) ;
183+ }
184+ if ( contracts . disputeKitGated ) {
185+ await verifyContractAddress ( contracts . disputeKitGated . getAddress ( ) ) ;
186+ }
187+ if ( contracts . disputeKitGatedShutter ) {
188+ await verifyContractAddress ( contracts . disputeKitGatedShutter . getAddress ( ) ) ;
189+ }
139190 await verifyContractAddress ( contracts . disputeResolver . getAddress ( ) ) ;
140191 await verifyContractAddress ( contracts . disputeTemplateRegistry . getAddress ( ) ) ;
141192 await verifyContractAddress ( contracts . evidence . getAddress ( ) ) ;
@@ -181,12 +232,15 @@ describe("getContractsEthers", () => {
181232 expect ( contracts . klerosCore ) . to . be . instanceOf ( getConstructor ( KlerosCore__factory , arbitrumSepoliaProvider ) ) ;
182233 expect ( contracts . sortition ) . to . be . instanceOf ( getConstructor ( SortitionModule__factory , arbitrumSepoliaProvider ) ) ;
183234 verifyCommonContractInstances ( contracts , arbitrumSepoliaProvider ) ;
235+ expect ( contracts . disputeKitShutter ) . to . not . be . null ;
236+ expect ( contracts . disputeKitGated ) . to . not . be . null ;
237+ expect ( contracts . disputeKitGatedShutter ) . to . not . be . null ;
184238 expect ( contracts . chainlinkRng ) . to . not . be . null ;
185239 expect ( contracts . randomizerRng ) . to . be . null ;
186240
187241 // Verify all contract addresses
188242 await verifyAllContractAddresses ( contracts ) ;
189- await verifyDeployedAddresses ( contracts , NETWORKS . DEVNET , baseContractMapping ) ;
243+ await verifyDeployedAddresses ( contracts , NETWORKS . DEVNET , devnetContractMapping ) ;
190244 } ) ;
191245
192246 it ( "should return correct contract instances for university" , async ( ) => {
@@ -204,6 +258,9 @@ describe("getContractsEthers", () => {
204258 getConstructor ( SortitionModuleUniversity__factory , arbitrumSepoliaProvider )
205259 ) ;
206260 verifyCommonContractInstances ( contracts , arbitrumSepoliaProvider ) ;
261+ expect ( contracts . disputeKitShutter ) . to . be . null ;
262+ expect ( contracts . disputeKitGated ) . to . be . null ;
263+ expect ( contracts . disputeKitGatedShutter ) . to . be . null ;
207264 expect ( contracts . chainlinkRng ) . to . not . be . null ;
208265 expect ( contracts . randomizerRng ) . to . be . null ;
209266
@@ -223,12 +280,15 @@ describe("getContractsEthers", () => {
223280 expect ( contracts . klerosCore ) . to . be . instanceOf ( getConstructor ( KlerosCore__factory , arbitrumSepoliaProvider ) ) ;
224281 expect ( contracts . sortition ) . to . be . instanceOf ( getConstructor ( SortitionModule__factory , arbitrumSepoliaProvider ) ) ;
225282 verifyCommonContractInstances ( contracts , arbitrumSepoliaProvider ) ;
283+ expect ( contracts . disputeKitShutter ) . to . be . null ;
284+ expect ( contracts . disputeKitGated ) . to . be . null ;
285+ expect ( contracts . disputeKitGatedShutter ) . to . be . null ;
226286 expect ( contracts . chainlinkRng ) . to . not . be . null ;
227287 expect ( contracts . randomizerRng ) . to . be . null ;
228288
229289 // Verify all contract addresses
230290 await verifyAllContractAddresses ( contracts ) ;
231- await verifyDeployedAddresses ( contracts , NETWORKS . TESTNET , baseContractMapping ) ;
291+ await verifyDeployedAddresses ( contracts , NETWORKS . TESTNET , testnetContractMapping ) ;
232292 } ) ;
233293
234294 it ( "should return correct contract instances for mainnetNeo" , async ( ) => {
@@ -242,6 +302,9 @@ describe("getContractsEthers", () => {
242302 expect ( contracts . klerosCore ) . to . be . instanceOf ( getConstructor ( KlerosCoreNeo__factory , arbitrumProvider ) ) ;
243303 expect ( contracts . sortition ) . to . be . instanceOf ( getConstructor ( SortitionModuleNeo__factory , arbitrumProvider ) ) ;
244304 verifyCommonContractInstances ( contracts , arbitrumProvider ) ;
305+ expect ( contracts . disputeKitShutter ) . to . be . null ;
306+ expect ( contracts . disputeKitGated ) . to . be . null ;
307+ expect ( contracts . disputeKitGatedShutter ) . to . be . null ;
245308 expect ( contracts . chainlinkRng ) . to . not . be . null ;
246309 expect ( contracts . randomizerRng ) . to . not . be . null ;
247310
0 commit comments