From 7dadbb3087a86af12bd9a1faa96a853e3b63fef4 Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Fri, 25 Oct 2024 13:25:42 +0200 Subject: [PATCH] fix lint --- l1-contracts/contracts/bridge/L1BridgeContractErrors.sol | 3 +++ l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/l1-contracts/contracts/bridge/L1BridgeContractErrors.sol b/l1-contracts/contracts/bridge/L1BridgeContractErrors.sol index f0e3c7dec..4db576573 100644 --- a/l1-contracts/contracts/bridge/L1BridgeContractErrors.sol +++ b/l1-contracts/contracts/bridge/L1BridgeContractErrors.sol @@ -28,3 +28,6 @@ error ClaimFailedDepositFailed(); // 0x636c90db error WrongL2Sender(address providedL2Sender); + +// 0xb4aeddbc +error WrongCounterpart(); diff --git a/l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol b/l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol index 941abc9b7..57a85b938 100644 --- a/l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol +++ b/l1-contracts/contracts/bridge/ntv/L1NativeTokenVault.sol @@ -22,7 +22,7 @@ import {ETH_TOKEN_ADDRESS} from "../../common/Config.sol"; import {L2_NATIVE_TOKEN_VAULT_ADDR} from "../../common/L2ContractAddresses.sol"; import {DataEncoding} from "../../common/libraries/DataEncoding.sol"; -import {OriginChainIdNotFound, Unauthorized, ZeroAddress, NoFundsTransferred, InsufficientChainBalance, WithdrawFailed} from "../../common/L1ContractErrors.sol"; +import {OriginChainIdNotFound, Unauthorized, ZeroAddress, NoFundsTransferred, InsufficientChainBalance, WithdrawFailed, WrongCounterpart} from "../../common/L1ContractErrors.sol"; import {ClaimFailedDepositFailed, ZeroAmountToTransfer, WrongAmountTransferred} from "../L1BridgeContractErrors.sol"; /// @author Matter Labs @@ -137,7 +137,9 @@ contract L1NativeTokenVault is IL1NativeTokenVault, IL1AssetHandler, NativeToken address, address _assetHandlerAddressOnCounterpart ) external view override onlyAssetRouter { - require(_assetHandlerAddressOnCounterpart == L2_NATIVE_TOKEN_VAULT_ADDR, "NTV: wrong counterpart"); + if (_assetHandlerAddressOnCounterpart != L2_NATIVE_TOKEN_VAULT_ADDR) { + revert WrongCounterpart(); + } } function _getOriginChainId(bytes32 _assetId) internal view returns (uint256) {