diff --git a/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererFalse.sol b/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererFalse.sol index 87448c1a5..8e210c886 100644 --- a/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererFalse.sol +++ b/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererFalse.sol @@ -9,7 +9,7 @@ contract TransactionFiltererFalse is ITransactionFilterer { // add this to be excluded from coverage report function test() internal virtual {} - function isTransactionAllowed(BridgehubL2TransactionRequest memory) external view returns (bool) { + function isTransactionAllowed(address, address, uint256, uint256) external view returns (bool){ return false; } } diff --git a/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererTrue.sol b/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererTrue.sol index c8e5f1c7f..8aa5862bc 100644 --- a/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererTrue.sol +++ b/l1-contracts/contracts/dev-contracts/test/DummyTransactionFiltererTrue.sol @@ -9,7 +9,7 @@ contract TransactionFiltererTrue is ITransactionFilterer { // add this to be excluded from coverage report function test() internal virtual {} - function isTransactionAllowed(BridgehubL2TransactionRequest memory) external view returns (bool) { + function isTransactionAllowed(address, address, uint256, uint256) external view returns (bool){ return true; } } diff --git a/l1-contracts/contracts/state-transition/chain-deps/facets/Mailbox.sol b/l1-contracts/contracts/state-transition/chain-deps/facets/Mailbox.sol index 21c508ce0..e6f6d13db 100644 --- a/l1-contracts/contracts/state-transition/chain-deps/facets/Mailbox.sol +++ b/l1-contracts/contracts/state-transition/chain-deps/facets/Mailbox.sol @@ -229,7 +229,12 @@ contract MailboxFacet is ZkSyncStateTransitionBase, IMailbox { ) internal nonReentrant returns (bytes32 canonicalTxHash) { // Check that the transaction is allowed by the filterer (if the filterer is set). if (s.transactionFilterer != address(0)) { - require(ITransactionFilterer(s.transactionFilterer).isTransactionAllowed(_request), "tf"); + require(ITransactionFilterer(s.transactionFilterer).isTransactionAllowed( + _request.sender, + _request.contractL2, + _request.mintValue, + _request.l2Value), + "tf"); } // Change the sender address if it is a smart contract to prevent address collision between L1 and L2. // Please note, currently zkSync address derivation is different from Ethereum one, but it may be changed in the future. diff --git a/l1-contracts/contracts/state-transition/chain-interfaces/ITransactionFilterer.sol b/l1-contracts/contracts/state-transition/chain-interfaces/ITransactionFilterer.sol index a7c02a6b9..20c5ce854 100644 --- a/l1-contracts/contracts/state-transition/chain-interfaces/ITransactionFilterer.sol +++ b/l1-contracts/contracts/state-transition/chain-interfaces/ITransactionFilterer.sol @@ -4,9 +4,9 @@ pragma solidity 0.8.20; import {BridgehubL2TransactionRequest} from "../../common/Messaging.sol"; -/// @title The interface of the L1 <-> L2 transaction filterer. +/// @title The interface of the L1 -> L2 transaction filterer. /// @author Matter Labs /// @custom:security-contact security@matterlabs.dev interface ITransactionFilterer { - function isTransactionAllowed(BridgehubL2TransactionRequest memory _request) external view returns (bool); + function isTransactionAllowed(address sender, address contractL2, uint256 mintValue, uint256 l2Value) external view returns (bool); }