Skip to content

Commit

Permalink
fix: [ALC-2] check paymaster address in hook as well (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik authored Nov 25, 2024
1 parent 3ee82bf commit d83d463
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/modules/permissions/PaymasterGuardModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d83d463

Please sign in to comment.