-
Notifications
You must be signed in to change notification settings - Fork 387
Draft: Adapting contracts for zksync os v30 #1626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
0xValera
merged 228 commits into
draft-v30
from
sb-adapting-contracts-for-zksync-os-v30
Sep 29, 2025
Merged
Changes from all commits
Commits
Show all changes
228 commits
Select commit
Hold shift + click to select a range
d26e845
Boojum OS initial draft version
AntonD3 7b1536d
Some fixes
AntonD3 6b56f03
Some fixes
AntonD3 17e3fd1
One more fix
AntonD3 28b7570
reintroduce method
StanislavBreadless e644ea6
Add upgrade tx hash to public input
AntonD3 d9f5a86
Enable boojum os flag by default
AntonD3 faebd92
Use 20 bytes for l2 da validator in PI
AntonD3 58b6e83
Save batch output hash in the commitment
AntonD3 42be22c
Update plonk verifier
AntonD3 b45691c
comment out some assertions that don't apply to zkos
RomanBrodetski f14043f
change commitment in storedBatchInfo to use non-packed preimage
RomanBrodetski 7393112
revert to packed version of commitment
RomanBrodetski 512b7e6
Update plonk verifier
AntonD3 b70c165
Update plonk verifier
AntonD3 e91d9f3
Update verifier
AntonD3 ded5f76
wip
StanislavBreadless 7bf163c
wip
StanislavBreadless 2ff2394
delete constructors
StanislavBreadless 8c26f7b
tmp fix scripts
StanislavBreadless eeba00a
fast compilation + make compiler work
StanislavBreadless 434cda9
fmt
StanislavBreadless 9f2aa30
updated VK for 0.2.0
mm-zk dad38d7
wip
StanislavBreadless 7ce8c7c
port d8d0d3e52082987b35d28b40a5b3c89ff2683f48
Raid5594 3bb2d79
add a small test for hashing
Raid5594 916280d
include force deployment info
StanislavBreadless 17a0ad6
fix lock files
StanislavBreadless a221e7f
use force deploy
StanislavBreadless af6aa77
remove unneeded methods
StanislavBreadless e6c2f63
fix
StanislavBreadless f0037e4
cleanup
StanislavBreadless b73d200
keep the old fix
StanislavBreadless 696d967
updated key to 0.3.1 airbender
mm-zk ec72efd
updated key again
mm-zk 00b64d6
some refactor
StanislavBreadless 69f5a77
some more cleanup
StanislavBreadless 90a4521
fmt
StanislavBreadless 23f7860
more fixes
StanislavBreadless 12c5407
upd commands
StanislavBreadless c5f10cb
Merge branch 'release-v28' into sb-adapting-contracts-for-zksync-os
StanislavBreadless 3659e7f
sync with draft-v29
StanislavBreadless ee75bb9
split chain asset handler
StanislavBreadless 49b8c3f
adapt scripts
StanislavBreadless 53d4146
minor cleanups
StanislavBreadless 875e418
lint
StanislavBreadless 59a9978
Update Verification keys
zksync-dev-robot c02c128
added support for ohBender and updated keys. (#1543)
mm-zk 1bbef40
Updated keys to 0.3.3 (fix)
mm-zk d1d9516
partial lint resolve
StanislavBreadless d211870
fmt
StanislavBreadless 492e870
fmt
StanislavBreadless 910d5e6
feat: Kl/zkos default upgrades (#1554)
kelemeno 9b250aa
interop
koloz193 d681d16
Merge remote-tracking branch 'origin/zksync-os-stable' into zk-zksync…
koloz193 49c3156
i
koloz193 466d705
feat: Mock verifier (#1581)
mm-zk eec56fb
sync with base
StanislavBreadless da6aa66
allow mock verifier on sepolia testnet
RomanBrodetski 2149c82
Merge pull request #1584 from matter-labs/RomanBrodetski-patch-1
RomanBrodetski e89f6f1
merge sb-adapting-contracts-for-zksync-os
perekopskiy a848804
pass correct factory deps
perekopskiy e621116
fix
perekopskiy 20c97ba
Merge branch 'draft-v30' into sb-adapting-contracts-for-zksync-os-v30
StanislavBreadless 63ccbbc
support upgrade tx in zkos executor
perekopskiy 28aa62a
Merge remote-tracking branch 'origin/zk-zksync-os-interop' into merge…
koloz193 0547d2f
fix compile
StanislavBreadless 71f032f
Update PLONK Verifier based on new VK from multiblock
EmilLuta 6f62197
feta(zksync-os): merge sb-adapting-contracts-for-zksync-os to zksync-…
perekopskiy 6227840
Merge pull request #1601 from matter-labs/evl-update-plonk-vk-v0-3-3-…
EmilLuta 758b628
add interop root to batch PI and lint
koloz193 31d946d
Merge branch 'zksync-os-stable' into zk/zksync-os-stable-v29
koloz193 12ed1ee
recompute hashes
koloz193 55ffec8
add v29 stage patch script
zkzoomer 2138cd9
lint
zkzoomer b72ec75
rm old MailboxFacet
zkzoomer 526d210
fixes
zkzoomer f998d83
specify facet cuts
zkzoomer 3835f25
rm unused
zkzoomer d63f122
Merge branch 'draft-v29' into zk/zksync-os-stable-v29
koloz193 59a0a30
renaming
zkzoomer 5144ad0
Revert "specify facet cuts"
zkzoomer 17e93b0
minor fix
zkzoomer 35212a6
rm unused
zkzoomer d9b9da8
Revert "rm unused"
zkzoomer 00bf6a6
rm unused
zkzoomer c40ece4
Revert "rm unused"
zkzoomer 592e1ac
read previous verifiers
zkzoomer 6c1067a
rm unused
zkzoomer a7caac6
lint
zkzoomer 0a1a307
modify check
zkzoomer ab5c11c
lint
zkzoomer 4ce1435
fix hashes
zkzoomer 682a5e8
bump hashes
koloz193 1d3efb6
update genesis
zkzoomer 19cd015
fix force deployment
zkzoomer 0205bd3
fix hashes
zkzoomer 4bb12c7
update genesis
zkzoomer edbb95a
save to file
zkzoomer f4a6ede
add run
zkzoomer 61c63fb
lint
zkzoomer 6388439
rm unused
zkzoomer 183b87a
add genesis upgrade addr
zkzoomer cc1f536
update run
zkzoomer e2721f4
add diamond init addr
zkzoomer e7ef3d8
add set new version call
zkzoomer 9017426
add existing facets
zkzoomer c1a9ca6
add stage0, stage2
zkzoomer ba43fca
update run
zkzoomer 1213742
bump new protocol version
zkzoomer c856d26
sync with base
StanislavBreadless 0b7f57e
Merge remote-tracking branch 'origin/sma/v29.1-patch-scripts' into zk…
koloz193 ac0e310
bump hashes
koloz193 0da2020
fix getFactoryDeps
perekopskiy f79c9fd
feat: update Plonk verifier
dimazhornyk c796928
Merge pull request #1608 from matter-labs/dz-update-plonk-vk
RomanBrodetski c0c232f
keep old vk
perekopskiy 9495316
Merge pull request #1596 from matter-labs/zk/zksync-os-stable-v29
perekopskiy ee3fcdc
remove zkos specific changes
koloz193 a7d4380
remove more zkos references
koloz193 8a79a33
feat: Elastic verifier, that allows owner to set multiple VKs (#1599)
mm-zk c029b98
Update vk from script (zkos wrapper v0.4.3 and zkos v0.0.20) (#1612)
mm-zk 74a9dda
fix: merge conflicts
Raid5594 7a53c65
make compile
StanislavBreadless 69396ab
add back onlyL2 modifier
koloz193 620276e
Merge branch 'draft-v29' into draft-v29.5
koloz193 23beee0
change L1->L2/upgrade tx type ids
itegulov 139fac5
Merge remote-tracking branch 'origin/draft-v29' into draft-v29.5
zkzoomer ccbe998
support both era and zksync-os
itegulov 704a591
address comments
itegulov d114f24
use correct tx type during deploy
itegulov fe1d560
change type id to 0x7d/0x7f
itegulov 6699157
pure->view
itegulov 5358b14
remove redundant force data deployment generation
Deniallugo 339c9c2
refactor into methods
itegulov 76aa2c4
Merge pull request #1620 from matter-labs/di/zksync-os-stable
itegulov 3899ae0
Update era contracts - server: d62892c, wrapper: v0.4.3
itegulov 9cbc849
Merge pull request #1622 from matter-labs/update-vk-from-script-20250…
itegulov 481a57d
fix: small fixes/improvements (#1627)
AntonD3 1f8053e
Some fixes. Comments, constructor removal, lint
0xValera c285bbd
comment
0xValera 0931202
Merge remote-tracking branch 'origin/draft-v29.5' into sb-adapting-co…
0xValera 3c1cb06
lint
0xValera ce06092
Merge remote-tracking branch 'origin/zksync-os-stable' into sb-adapti…
0xValera 377f9c9
some fixes on the way to compilation
0xValera 9c4373c
make compilable
0xValera 5302b60
some fixes, lint
0xValera 255bf3e
more fixes
0xValera 7efa454
fix build
0xValera 039f531
fix links
0xValera 83e50a6
fix deploy script
0xValera 8c29a0a
move ComplexUpgrader and L2GenesisUpgrader tests to l1-contracts
0xValera e6dbffb
TO REVERT: not require lint for tests and coverage in l1-contracts
0xValera 7d6c89c
various ci fixes (#1621)
zkzoomer e0def62
bump ComplexUpgrader, L2GenesisUpgrade locations
0xValera e6b6f4c
skip assembly in L1 slither due to slither issue
0xValera de359e0
slither fixes
0xValera 760c108
slither fix
0xValera 72a2b62
fix errors lint
0xValera 75d0514
Revert "TO REVERT: not require lint for tests and coverage in l1-cont…
0xValera 2530839
lint
0xValera 2c9e6d9
fix scripts
0xValera 5c999b3
fix link
0xValera a5dc308
upd links (#1632)
StanislavBreadless 3c2e89e
Merge remote-tracking branch 'origin/zksync-os-stable' into sb-adapti…
0xValera 9577337
restore CI elements, make build
0xValera 4ec853e
ignore L2GenesisUpgrade+L2ComplexUpgrader tests in l1 CI
0xValera 5c9c5f4
fix test
0xValera bdad82f
fix foundry-zksync tests
0xValera 6f97428
Merge remote-tracking branch 'origin/zksync-os-stable' into ra/zksync…
Raid5594 6e00490
feat: update scripts to enable saving calldata (#1631)
Raid5594 08f14a6
remove unnecessary deploy
Raid5594 c81ea82
resolve a few comments
Raid5594 a11c31d
fix: add comments
Raid5594 4ef514c
Merge branch 'draft-v30' of https://github.com/matter-labs/era-contra…
0xValera 1380818
fix: refactoring
Raid5594 1eaa26f
add back deploy gov/admin
Raid5594 8192316
typo
0xValera 6547bdc
Delete L2VerifierPlonk.sol
0xValera 54cbc4d
Merge branch 'draft-v30' of https://github.com/matter-labs/era-contra…
0xValera 89d8d84
fix build
0xValera b6de41e
Merge branch 'draft-v30' into sb-adapting-contracts-for-zksync-os-v30
0xValera a70efd5
lint
0xValera 5f35f09
Update AllContractsHashes.json
0xValera f808d2d
fix bootloader testing (bump zksync-era commit)
0xValera 4684b45
feat(scripts): Added wallets for prove & execute (#1640)
mm-zk cd00919
Merge remote-tracking branch 'origin/draft-v29' into ra/zksync-os-sta…
Raid5594 f644f88
fix: consturctor args to message root
Raid5594 48d2216
fix: hashes
Raid5594 da4f761
feat: add helper script
Raid5594 dbcce37
update factorydeps
0xValera 46fe7e6
fix: lint
Raid5594 fca9d97
wip
Raid5594 1e9580c
fix: typo + lint
Raid5594 c280745
Update RegisterZKChain.s.sol
0xValera 8333778
chore: refactoring
Raid5594 e6b8531
Merge remote-tracking branch 'origin/draft-v29' into ra/zksync-os-sta…
Raid5594 2f3f756
Ra/zksync os stable split scripts for zkstack cli (#1613)
Raid5594 5014886
Revert "Ra/zksync os stable split scripts for zkstack cli" (#1647)
Raid5594 8591ff3
Merge pull request #1648 from matter-labs/ra/zksync-os-stable-split-s…
Raid5594 bea8f12
Update GatewayVotePreparation.s.sol
0xValera ef6ab9c
Update era contracts - zkos: v0.0.25, wrapper: v0.4.6 (#1672)
mm-zk 8289273
Merge branch 'draft-v30' of https://github.com/matter-labs/era-contra…
0xValera 7aa66e8
build fixes after merge, lint, hashes
0xValera 15a7917
Update VerifierPlonk.sol
0xValera c4100fe
regenerate verifier
0xValera ce1b113
some fixes
0xValera 6cc9111
L2_NTV_BEACON_DEPLOYER_ADDR -> L2ContractAddresses
0xValera d88e9c3
OhBender -> ZKsync OS
0xValera 834d8d6
foundry optimizer settings
0xValera a9f04bf
fix passing of parameters in L2NativeTokenVaultL1Test
0xValera af13f72
return vm.snapshotGasLastCall
0xValera 362365e
set ZKsyncOS flag to false
0xValera 34643da
fix typo
0xValera 177b776
uncomment test_startMessageToL2
0xValera 70e4918
add maxNumberOfZKChains to SystemContractsArgs
0xValera 8d449b8
remove redundant build:foundry-fast
0xValera 443cde3
add addChainBatchRoot to MRBase, we should have it on L1 in v30
0xValera a3a3875
Merge branch 'zksync-os-stable' of https://github.com/matter-labs/era…
0xValera 7d8ef02
fixes after merge
0xValera 3be8992
ctmChainId -> ctmRepresentativeChainId
0xValera 0b28d7b
Merge branch 'draft-v30' of https://github.com/matter-labs/era-contra…
0xValera 20b6edf
fix verifier
0xValera 50a9bd5
fix hashes
0xValera ee8f83a
Merge branch 'draft-v30' of https://github.com/matter-labs/era-contra…
0xValera a85b79a
fix imports after resolving conflicts
0xValera f0f99cb
lint
0xValera 3e9bec3
fix hashes
0xValera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import {IBridgehub} from "../../bridgehub/IBridgehub.sol"; | |
import {AddressAliasHelper} from "../../vendor/AddressAliasHelper.sol"; | ||
import {ReentrancyGuard} from "../../common/ReentrancyGuard.sol"; | ||
|
||
import {L2_BRIDGEHUB_ADDR, L2_NATIVE_TOKEN_VAULT_ADDR} from "../../common/l2-helpers/L2ContractAddresses.sol"; | ||
import {L2_BRIDGEHUB_ADDR, L2_COMPLEX_UPGRADER_ADDR, L2_NATIVE_TOKEN_VAULT_ADDR} from "../../common/l2-helpers/L2ContractAddresses.sol"; | ||
import {L2ContractHelper} from "../../common/l2-helpers/L2ContractHelper.sol"; | ||
import {DataEncoding} from "../../common/libraries/DataEncoding.sol"; | ||
import {AmountMustBeGreaterThanZero, AssetIdNotSupported, EmptyAddress, InvalidCaller, TokenNotLegacy} from "../../common/L1ContractErrors.sol"; | ||
|
@@ -24,19 +24,41 @@ import {AmountMustBeGreaterThanZero, AssetIdNotSupported, EmptyAddress, InvalidC | |
/// @custom:security-contact [email protected] | ||
/// @notice The "default" bridge implementation for the ERC20 tokens. Note, that it does not | ||
/// support any custom token logic, i.e. rebase tokens' functionality is not supported. | ||
/// @dev Important: L2 contracts are not allowed to have any immutable variables or constructors. This is needed for compatibility with ZKsyncOS. | ||
contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | ||
/// @dev The address of the L2 legacy shared bridge. | ||
address public immutable L2_LEGACY_SHARED_BRIDGE; | ||
/// @dev Bridgehub smart contract that is used to operate with L2 via asynchronous L2 <-> L1 communication. | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
IBridgehub public override BRIDGE_HUB; | ||
|
||
/// @dev The asset id of the base token. | ||
bytes32 public immutable BASE_TOKEN_ASSET_ID; | ||
/// @dev Chain ID of L1 for bridging reasons. | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
uint256 public L1_CHAIN_ID; | ||
|
||
/// @dev Chain ID of Era for legacy reasons. | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
uint256 public eraChainId; | ||
|
||
/// @dev The address of the L1 asset router counterpart. | ||
address public immutable override L1_ASSET_ROUTER; | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
address public L1_ASSET_ROUTER; | ||
|
||
/// @dev The address of the L2 legacy shared bridge. | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
address public L2_LEGACY_SHARED_BRIDGE; | ||
|
||
/// @dev The asset id of the base token. | ||
/// @dev Note, that while it is a simple storage variable, the name is in capslock for the backward compatibility with | ||
/// the old version where it was an immutable. | ||
bytes32 public BASE_TOKEN_ASSET_ID; | ||
|
||
/// @notice Checks that the message sender is the L1 Asset Router. | ||
modifier onlyAssetRouterCounterpart(uint256 _originChainId) { | ||
if (_originChainId == L1_CHAIN_ID) { | ||
if (_originChainId == _l1ChainId()) { | ||
// Only the L1 Asset Router counterpart can initiate and finalize the deposit. | ||
if (AddressAliasHelper.undoL1ToL2Alias(msg.sender) != L1_ASSET_ROUTER) { | ||
revert InvalidCaller(msg.sender); | ||
|
@@ -49,7 +71,7 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
|
||
/// @notice Checks that the message sender is the L1 Asset Router. | ||
modifier onlyAssetRouterCounterpartOrSelf(uint256 _chainId) { | ||
if (_chainId == L1_CHAIN_ID) { | ||
if (_chainId == _l1ChainId()) { | ||
// Only the L1 Asset Router counterpart can initiate and finalize the deposit. | ||
if ((AddressAliasHelper.undoL1ToL2Alias(msg.sender) != L1_ASSET_ROUTER) && (msg.sender != address(this))) { | ||
revert InvalidCaller(msg.sender); | ||
|
@@ -75,26 +97,61 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
_; | ||
} | ||
|
||
/// @dev Disable the initialization to prevent Parity hack. | ||
/// @dev this contract is deployed in the L2GenesisUpgrade, and is meant as direct deployment without a proxy. | ||
/// @param _l1AssetRouter The address of the L1 Bridge contract. | ||
constructor( | ||
/// @dev Only allows calls from the complex upgrader contract on L2. | ||
modifier onlyUpgrader() { | ||
if (msg.sender != L2_COMPLEX_UPGRADER_ADDR) { | ||
revert InvalidCaller(msg.sender); | ||
} | ||
_; | ||
} | ||
|
||
/// @notice Initializes the contract. | ||
/// @dev This function is used to initialize the contract with the initial values. | ||
/// @param _l1ChainId The chain id of L1. | ||
/// @param _eraChainId The chain id of Era. | ||
/// @param _l1AssetRouter The address of the L1 asset router. | ||
/// @param _legacySharedBridge The address of the L2 legacy shared bridge. | ||
/// @param _baseTokenAssetId The asset id of the base token. | ||
/// @param _aliasedOwner The address of the owner of the contract. | ||
function initL2( | ||
uint256 _l1ChainId, | ||
uint256 _eraChainId, | ||
address _l1AssetRouter, | ||
address _legacySharedBridge, | ||
bytes32 _baseTokenAssetId, | ||
address _aliasedOwner | ||
) AssetRouterBase(_l1ChainId, _eraChainId, IBridgehub(L2_BRIDGEHUB_ADDR)) reentrancyGuardInitializer { | ||
) public reentrancyGuardInitializer onlyUpgrader { | ||
_disableInitializers(); | ||
// solhint-disable-next-line func-named-parameters | ||
updateL2(_l1ChainId, _eraChainId, _l1AssetRouter, _legacySharedBridge, _baseTokenAssetId); | ||
_setAssetHandler(_baseTokenAssetId, L2_NATIVE_TOKEN_VAULT_ADDR); | ||
_transferOwnership(_aliasedOwner); | ||
} | ||
|
||
/// @notice Updates the contract. | ||
/// @dev This function is used to initialize the new implementation of L2AssetRouter on existing chains during | ||
/// the upgrade. | ||
/// @param _l1ChainId The chain id of L1. | ||
/// @param _eraChainId The chain id of Era. | ||
/// @param _l1AssetRouter The address of the L1 asset router. | ||
/// @param _legacySharedBridge The address of the L2 legacy shared bridge. | ||
/// @param _baseTokenAssetId The asset id of the base token. | ||
function updateL2( | ||
uint256 _l1ChainId, | ||
uint256 _eraChainId, | ||
address _l1AssetRouter, | ||
address _legacySharedBridge, | ||
bytes32 _baseTokenAssetId | ||
) public onlyUpgrader { | ||
L2_LEGACY_SHARED_BRIDGE = _legacySharedBridge; | ||
if (_l1AssetRouter == address(0)) { | ||
revert EmptyAddress(); | ||
} | ||
L1_CHAIN_ID = _l1ChainId; | ||
L1_ASSET_ROUTER = _l1AssetRouter; | ||
_setAssetHandler(_baseTokenAssetId, L2_NATIVE_TOKEN_VAULT_ADDR); | ||
BASE_TOKEN_ASSET_ID = _baseTokenAssetId; | ||
_disableInitializers(); | ||
_transferOwnership(_aliasedOwner); | ||
eraChainId = _eraChainId; | ||
BRIDGE_HUB = IBridgehub(L2_BRIDGEHUB_ADDR); | ||
} | ||
|
||
/// @inheritdoc IL2AssetRouter | ||
|
@@ -136,15 +193,15 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
public | ||
payable | ||
override(AssetRouterBase, IAssetRouterBase) | ||
onlyAssetRouterCounterpartOrSelf(L1_CHAIN_ID) | ||
onlyAssetRouterCounterpartOrSelf(_l1ChainId()) | ||
nonReentrant | ||
{ | ||
if (_assetId == BASE_TOKEN_ASSET_ID) { | ||
revert AssetIdNotSupported(BASE_TOKEN_ASSET_ID); | ||
} | ||
_finalizeDeposit(L1_CHAIN_ID, _assetId, _transferData, L2_NATIVE_TOKEN_VAULT_ADDR); | ||
_finalizeDeposit(_l1ChainId(), _assetId, _transferData, L2_NATIVE_TOKEN_VAULT_ADDR); | ||
|
||
emit DepositFinalizedAssetRouter(L1_CHAIN_ID, _assetId, _transferData); | ||
emit DepositFinalizedAssetRouter(_l1ChainId(), _assetId, _transferData); | ||
} | ||
|
||
/// @notice Initiates a withdrawal by burning funds on the contract and sending the message to L1 | ||
|
@@ -177,7 +234,7 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
bool _alwaysNewMessageFormat | ||
) internal returns (bytes32 txHash) { | ||
bytes memory l1bridgeMintData = _burn({ | ||
_chainId: L1_CHAIN_ID, | ||
_chainId: _l1ChainId(), | ||
_nextMsgValue: 0, | ||
_assetId: _assetId, | ||
_originalCaller: _sender, | ||
|
@@ -204,7 +261,7 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
txHash = IL2SharedBridgeLegacy(L2_LEGACY_SHARED_BRIDGE).sendMessageToL1(message); | ||
} | ||
|
||
emit WithdrawalInitiatedAssetRouter(L1_CHAIN_ID, _sender, _assetId, _assetData); | ||
emit WithdrawalInitiatedAssetRouter(_l1ChainId(), _sender, _assetId, _assetData); | ||
} | ||
|
||
/// @notice Encodes the message for l2ToL1log sent during withdraw initialization. | ||
|
@@ -362,4 +419,16 @@ contract L2AssetRouter is AssetRouterBase, IL2AssetRouter, ReentrancyGuard { | |
function l1Bridge() external view returns (address) { | ||
return L1_ASSET_ROUTER; | ||
} | ||
|
||
function _bridgehub() internal pure override returns (IBridgehub) { | ||
return IBridgehub(L2_BRIDGEHUB_ADDR); | ||
} | ||
|
||
function _l1ChainId() internal view override returns (uint256) { | ||
return L1_CHAIN_ID; | ||
} | ||
|
||
function _eraChainId() internal view override returns (uint256) { | ||
return eraChainId; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.