@@ -59,7 +59,7 @@ def finalize_withdrawl_transaction(self, tx):
59
59
60
60
finalize_withdrawl_transaction_tx = self .contract .functions .finalizeWithdrawalTransaction (tx ).build_transaction ({
61
61
"from" : self .account .address ,
62
- "gas" : 500000 ,
62
+ "gas" : 100000 ,
63
63
"nonce" : self .provider .eth .get_transaction_count (self .account .address )
64
64
})
65
65
@@ -68,9 +68,13 @@ def finalize_withdrawl_transaction(self, tx):
68
68
def is_output_finalized ():
69
69
pass
70
70
71
- def proven_withdrawls (self , withdrawl_hash ):
71
+ def proof_maturity_delay_seconds (self ):
72
+
73
+ return self .contract .functions .proofMaturityDelaySeconds ().call ()
72
74
73
- return self .contract .functions .provenWithdrawals (withdrawl_hash ).call ()
75
+ def proven_withdrawls (self , withdrawl_hash , proof_submitter ):
76
+
77
+ return self .contract .functions .provenWithdrawals (withdrawl_hash , proof_submitter ).call ()
74
78
75
79
class StandardBridge (Contract ):
76
80
@@ -278,6 +282,51 @@ def get_l2_output(self, l2_output_index):
278
282
279
283
return output_root .hex (), timestamp , l2_block_number
280
284
285
+ class DisputeGameFactory (Contract ):
286
+
287
+ def __init__ (self , chain_id_l1 , chain_id_l2 , provider = None ):
288
+
289
+ if provider is None :
290
+ self .provider = get_provider (chain_id_l1 )
291
+ else :
292
+ self .provider = provider
293
+
294
+ if is_chain_supported (chain_id_l1 ) is False :
295
+ raise Exception (f"Chain ID { chain_id_l1 } not supported: add it to the config.json file or open a request to add it." )
296
+ if is_chain_supported (chain_id_l2 ) is False :
297
+ raise Exception (f"Chain ID { chain_id_l2 } not supported: add it to the config.json file or open a request to add it." )
298
+
299
+ self .address = read_addresses (chain_id_l1 , chain_id_l2 , layer = "l1" )["DISPUTE_GAME_FACTORY" ]
300
+
301
+ self .contract = self .provider .eth .contract (address = self .address , abi = load_abi ("DISPUTE_GAME_FACTORY" ))
302
+
303
+ def game_count (self ):
304
+
305
+ return self .contract .functions .gameCount ().call ()
306
+
307
+ def game_at_index (self , index ):
308
+
309
+ return self .contract .functions .gameAtIndex (index ).call ()
310
+
311
+
312
+ class FaultDisputeGame (Contract ):
313
+
314
+ def __init__ (self , address , provider ):
315
+
316
+ self .provider = provider
317
+
318
+ self .address = address
319
+
320
+ self .contract = self .provider .eth .contract (address = self .address , abi = load_abi ("FAULT_DISPUTE_GAME" ))
321
+
322
+ def root_claim (self ):
323
+
324
+ return self .contract .functions .rootClaim ().call ()
325
+
326
+ def l2_block_number (self ):
327
+
328
+ return self .contract .functions .l2BlockNumber ().call ()
329
+
281
330
class L2ToL1MessagePasser (Contract ):
282
331
283
332
def __init__ (self , chain_id_l1 , chain_id_l2 , account , provider = None ):
@@ -297,7 +346,7 @@ def initiate_withdrawl(self, to, gas_limit, data, value):
297
346
298
347
initiate_withdrawl_tx = self .contract .functions .initiateWithdrawal (to , gas_limit , data ).build_transaction ({
299
348
"from" : self .account .address ,
300
- "gas" : 500000 ,
349
+ "gas" : 100000 ,
301
350
"nonce" : self .provider .eth .get_transaction_count (self .account .address ),
302
351
"value" : value
303
352
})
0 commit comments