Skip to content

Commit

Permalink
zk fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Mar 15, 2024
1 parent 8dd51e5 commit 02fc4e7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract TransactionFiltererFalse is ITransactionFilterer {
// add this to be excluded from coverage report
function test() internal virtual {}

function isTransactionAllowed(address, address, uint256, uint256, bytes memory) external view returns (bool){
function isTransactionAllowed(address, address, uint256, uint256, bytes memory) external view returns (bool) {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract TransactionFiltererTrue is ITransactionFilterer {
// add this to be excluded from coverage report
function test() internal virtual {}

function isTransactionAllowed(address, address, uint256, uint256, bytes memory) external view returns (bool){
function isTransactionAllowed(address, address, uint256, uint256, bytes memory) external view returns (bool) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,16 @@ 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.sender,
_request.contractL2,
_request.mintValue,
_request.l2Value,
_request.l2Calldata),
"tf");
require(
ITransactionFilterer(s.transactionFilterer).isTransactionAllowed(
_request.sender,
_request.contractL2,
_request.mintValue,
_request.l2Value,
_request.l2Calldata
),
"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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ interface ITransactionFilterer {
/// @param l2Value The msg.value of the L2 transaction
/// @param l2Calldata The calldata of the L2 transaction
/// @return Whether the transaction is allowed
function isTransactionAllowed(address sender, address contractL2, uint256 mintValue, uint256 l2Value, bytes memory l2Calldata) external view returns (bool);
function isTransactionAllowed(
address sender,
address contractL2,
uint256 mintValue,
uint256 l2Value,
bytes memory l2Calldata
) external view returns (bool);
}

0 comments on commit 02fc4e7

Please sign in to comment.