Skip to content

Commit

Permalink
refactor: use IZkSyncHyperchain.json as main contract
Browse files Browse the repository at this point in the history
  • Loading branch information
petarTxFusion committed Jun 7, 2024
1 parent 5aa7176 commit 81f8955
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main():
SALT = "0x293328ad84b118194c65a0dc0defdb6483740d3163fd99b260907e15f2e2f642"

from zksync2.account.wallet import Wallet
from zksync2.manage_contracts.utils import zksync_abi_default
from zksync2.manage_contracts.utils import get_zksync_hyperchain
from zksync2.module.module_builder import ZkSyncBuilder
from zksync2.signer.eth_signer import PrivateKeyEthSigner

Expand All @@ -32,7 +32,7 @@ def main():
wallet = Wallet(zksync, eth_web3, account)
zksync_contract = eth_web3.eth.contract(
Web3.to_checksum_address(zksync.zksync.main_contract_address),
abi=zksync_abi_default(),
abi=get_zksync_hyperchain(),
)

deposit_token(wallet, eth_web3, zksync, zksync_contract)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
from zksync2.manage_contracts.paymaster_utils import PaymasterFlowEncoder
from zksync2.manage_contracts.utils import (
zksync_abi_default,
get_zksync_hyperchain,
get_erc20_abi,
get_test_net_erc20_token,
)
Expand All @@ -58,7 +58,7 @@ def setUp(self) -> None:
self.wallet = Wallet(self.zksync, self.eth_web3, self.account)
self.zksync_contract = self.eth_web3.eth.contract(
Web3.to_checksum_address(self.zksync.zksync.main_contract_address),
abi=zksync_abi_default(),
abi=get_zksync_hyperchain(),
)
self.is_eth_based_chain = self.wallet.is_eth_based_chain()

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/test_zksync_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from tests.unit.test_config import LOCAL_ENV, EnvPrivateKey
from zksync2.core.utils import RecommendedGasLimit
from zksync2.manage_contracts.utils import zksync_abi_default
from zksync2.manage_contracts.utils import get_zksync_hyperchain
from zksync2.module.module_builder import ZkSyncBuilder
from zksync2.signer.eth_signer import PrivateKeyEthSigner

Expand All @@ -27,7 +27,7 @@ def setUp(self) -> None:
self.signer = PrivateKeyEthSigner(self.account, self.chain_id)
self.zksync_contract = self.eth_web3.eth.contract(
Web3.to_checksum_address(self.zksync.zksync.zks_main_contract()),
abi=zksync_abi_default(),
abi=get_zksync_hyperchain(),
)

def test_facet_addresses_call(self):
Expand Down Expand Up @@ -154,7 +154,7 @@ def test_request_l2_transaction(self):
l2_value = 0
contract = self.eth_web3.eth.contract(
Web3.to_checksum_address(self.zksync.zksync.zks_main_contract()),
abi=zksync_abi_default(),
abi=get_zksync_hyperchain(),
)
tx = contract.functions.requestL2Transaction(
Web3.to_checksum_address(self.zksync.zksync.zks_main_contract()),
Expand Down
1 change: 0 additions & 1 deletion zksync2/account/wallet_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
)
from zksync2.manage_contracts.deploy_addresses import ZkSyncAddresses
from zksync2.manage_contracts.utils import (
zksync_abi_default,
l1_bridge_abi_default,
get_erc20_abi,
l2_bridge_abi_default,
Expand Down
4 changes: 2 additions & 2 deletions zksync2/account/wallet_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)
from zksync2.manage_contracts.deploy_addresses import ZkSyncAddresses
from zksync2.manage_contracts.utils import (
zksync_abi_default,
get_zksync_hyperchain,
nonce_holder_abi_default,
l2_bridge_abi_default,
l2_shared_bridge_abi_default,
Expand All @@ -28,7 +28,7 @@ def __init__(self, zksync_web3: Web3, eth_web3: Web3, l1_account: BaseAccount):
self._l1_account = l1_account
self.contract = self._eth_web3.eth.contract(
Web3.to_checksum_address(self._main_contract_address),
abi=zksync_abi_default(),
abi=get_zksync_hyperchain(),
)

def get_balance(
Expand Down

0 comments on commit 81f8955

Please sign in to comment.