Skip to content

Commit

Permalink
fix: cache signature threshold to save gas
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOsiris committed Jan 24, 2025
1 parent 5515c85 commit 756e31d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/src/PBH4337Module.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ contract PBHSafe4337Module is Safe4337Module {
// A malicious bundler can pad the Safe operation `signatures` with additional bytes, causing the account to pay
// more gas than needed for user operation validation (capped by `verificationGasLimit`).
// `_checkSignaturesLength` ensures that there are no additional bytes in the `signature` than are required.
bool validSignature = _checkSignaturesLength(signatures, ISafe(payable(userOp.sender)).getThreshold());
bool validSignature = _checkSignaturesLength(signatures, threshold);

try ISafe(payable(userOp.sender)).checkSignatures(keccak256(operationData), operationData, signatures) {}
catch {
Expand Down

0 comments on commit 756e31d

Please sign in to comment.