Skip to content

Commit

Permalink
Update userOp.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmv08 committed Jun 8, 2022
1 parent e1e9f6b commit ccdd94b
Show file tree
Hide file tree
Showing 7 changed files with 850 additions and 525 deletions.
235 changes: 0 additions & 235 deletions CHANGELOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions contracts/SafeEIP4337Diatomic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "./UserOperation.sol";
error InvalidCaller();

/// @notice Thrown when userOp suggests a mismatching nonce
error InvalidNonce();
error InvalidNonce(uint256 actual, uint256 expected);

/// @notice Thrown when the prefund quoted by the entrypoint is larger than one defined in the userOp
error InvalidPrefund();
Expand Down Expand Up @@ -61,7 +61,7 @@ contract SafeEIP4337Diatomic is HandlerContext {

// We need to increase the nonce to make it impossible to drain the safe by making it send prefunds for the same transaction
uint256 safeNonce = safeNonces[safeAddress]++;
if (safeNonce != userOp.nonce) revert InvalidNonce();
if (safeNonce != userOp.nonce) revert InvalidNonce(userOp.nonce, safeNonce);

// We need to make sure that the entryPoint's requested prefund is in bounds
if (requiredPrefund > userOp.requiredPreFund()) revert InvalidPrefund();
Expand Down
Loading

0 comments on commit ccdd94b

Please sign in to comment.