From 7d30bdfc6f6f15a9bf1775691b3d071b2a761838 Mon Sep 17 00:00:00 2001 From: Jay Paik Date: Mon, 25 Nov 2024 11:28:02 -0500 Subject: [PATCH] fix: [ALC-2] check paymaster address in hook as well --- src/modules/permissions/PaymasterGuardModule.sol | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/permissions/PaymasterGuardModule.sol b/src/modules/permissions/PaymasterGuardModule.sol index c7d905ed..493a0c9b 100644 --- a/src/modules/permissions/PaymasterGuardModule.sol +++ b/src/modules/permissions/PaymasterGuardModule.sol @@ -65,11 +65,13 @@ contract PaymasterGuardModule is ModuleBase, IValidationHookModule { returns (uint256) { address payingPaymaster = address(bytes20(userOp.paymasterAndData[:20])); - if (payingPaymaster == paymasters[entityId][msg.sender]) { - return 0; - } else { + if (payingPaymaster == address(0)) { + revert InvalidPaymaster(); + } + if (payingPaymaster != paymasters[entityId][msg.sender]) { revert BadPaymasterSpecified(); } + return 0; } /// @inheritdoc IValidationHookModule