From 89728891a5e23db27625a5d6efd2a7be46978fbb Mon Sep 17 00:00:00 2001 From: petarTxFusion Date: Mon, 10 Jun 2024 21:34:00 +0200 Subject: [PATCH 1/2] fix(wallet): use `l2BridgeAddress` in `_get_l2_gas_limit_from_custom_bridge` --- zksync2/account/wallet_l1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zksync2/account/wallet_l1.py b/zksync2/account/wallet_l1.py index 940f78f..5a04424 100644 --- a/zksync2/account/wallet_l1.py +++ b/zksync2/account/wallet_l1.py @@ -834,11 +834,11 @@ def _get_l2_gas_limit_from_custom_bridge(self, transaction: DepositTransaction): if transaction.options.chain_id is None: transaction.options.chain_id = self._eth_web3.eth.chain_id - l2_address = bridge.functions.l2TokenAddress(transaction.token).call() + l2_bridge_address = bridge.functions.l2BridgeAddress(transaction.options.chain_id).call() return self.estimate_custom_bridge_deposit_l2_gas( transaction.bridge_address, - l2_address, + l2_bridge_address, transaction.token, transaction.amount, transaction.to, From b651d5ea57ee20bb90a61a3fd665fee329d3875e Mon Sep 17 00:00:00 2001 From: petarTxFusion Date: Mon, 10 Jun 2024 21:36:11 +0200 Subject: [PATCH 2/2] chore: lint code --- zksync2/account/wallet_l1.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zksync2/account/wallet_l1.py b/zksync2/account/wallet_l1.py index 5a04424..934c21d 100644 --- a/zksync2/account/wallet_l1.py +++ b/zksync2/account/wallet_l1.py @@ -834,7 +834,9 @@ def _get_l2_gas_limit_from_custom_bridge(self, transaction: DepositTransaction): if transaction.options.chain_id is None: transaction.options.chain_id = self._eth_web3.eth.chain_id - l2_bridge_address = bridge.functions.l2BridgeAddress(transaction.options.chain_id).call() + l2_bridge_address = bridge.functions.l2BridgeAddress( + transaction.options.chain_id + ).call() return self.estimate_custom_bridge_deposit_l2_gas( transaction.bridge_address,