From 5818450e8300f1b1939ba96ef54189b720f7d0b6 Mon Sep 17 00:00:00 2001 From: petarTxFusion Date: Fri, 7 Jun 2024 00:33:11 +0200 Subject: [PATCH] refactor: refactor `get_l2_bridge_contracts` to return `IL2SharedBridge` --- zksync2/account/wallet_l2.py | 8 ++++++-- zksync2/core/types.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/zksync2/account/wallet_l2.py b/zksync2/account/wallet_l2.py index bfec180..e9e90c6 100644 --- a/zksync2/account/wallet_l2.py +++ b/zksync2/account/wallet_l2.py @@ -12,7 +12,7 @@ from zksync2.manage_contracts.utils import ( zksync_abi_default, nonce_holder_abi_default, - l2_bridge_abi_default, + l2_bridge_abi_default, l2_shared_bridge_abi_default, ) from zksync2.module.response_types import ZksAccountBalances from zksync2.signer.eth_signer import PrivateKeyEthSigner @@ -74,9 +74,13 @@ def get_l2_bridge_contracts(self) -> L2BridgeContracts: address=Web3.to_checksum_address(addresses.erc20_l2_default_bridge), abi=l2_bridge_abi_default(), ), + weth=self._zksync_web3.eth.contract( + address=Web3.to_checksum_address(addresses.weth_bridge_l2), + abi=l2_bridge_abi_default(), + ), shared=self._zksync_web3.eth.contract( address=Web3.to_checksum_address(addresses.shared_l2_default_bridge), - abi=l2_bridge_abi_default(), + abi=l2_shared_bridge_abi_default(), ), ) diff --git a/zksync2/core/types.py b/zksync2/core/types.py index fadd7c3..e9c2609 100644 --- a/zksync2/core/types.py +++ b/zksync2/core/types.py @@ -100,6 +100,7 @@ class L1BridgeContracts: @dataclass class L2BridgeContracts: erc20: Contract + weth: Contract shared: Contract