Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zkbenny committed Mar 5, 2024
1 parent 3e170e2 commit 76716df
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions contracts/gateway/zksync/ZkSyncL1Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,10 @@ contract ZkSyncL1Gateway is IZkSyncL1Gateway, L1BaseGateway, BaseGateway {
// additionalData (sendMessage): l2Value + l2CallData >= 32 (bytes)
// It should be equal to the length of the function signature + eth receiver address + uint256 amount + l2Sender
// + additionalData >= 4 + 20 + 32 + 20 + 32 = 108 (bytes).
require(_message.length >= 108, "Incorrect ETH message with additional data length");
require(_message.length >= 108, "Incorrect message length");

(uint32 functionSignature, uint256 offset) = UnsafeBytes.readUint32(_message, 0);
require(
bytes4(functionSignature) == IMailbox.finalizeEthWithdrawal.selector,
"Incorrect ETH message function selector"
);
require(bytes4(functionSignature) == IMailbox.finalizeEthWithdrawal.selector, "Incorrect function selector");

address l1EthReceiver;
(l1EthReceiver, offset) = UnsafeBytes.readAddress(_message, offset);
Expand All @@ -124,7 +121,7 @@ contract ZkSyncL1Gateway is IZkSyncL1Gateway, L1BaseGateway, BaseGateway {

address l2Sender;
(l2Sender, offset) = UnsafeBytes.readAddress(_message, offset);
require(l2Sender == remoteGateway, "The withdrawal was not initiated by L2 gateway");
require(l2Sender == remoteGateway, "Not initiated by L2 gateway");

// Parse additional data
(l2Value, offset) = UnsafeBytes.readUint256(_message, offset);
Expand Down

0 comments on commit 76716df

Please sign in to comment.