Skip to content

Commit

Permalink
Typehash: constant private with _TYPEHASH suffix (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx authored Feb 10, 2025
1 parent abc2ff6 commit 03a756c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion contracts/account/paymaster/PaymasterCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity ^0.8.20;

import {ERC4337Utils} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
import {IEntryPoint, IPaymaster, PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";
import {ERC4337Utils} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";

/**
* @dev A simple ERC4337 paymaster implementation. This base implementation only includes the minimal logic to validate
Expand Down
8 changes: 3 additions & 5 deletions contracts/account/paymaster/PaymasterSigner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

pragma solidity ^0.8.20;

import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";
import {ERC4337Utils} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
import {ERC4337Utils, PackedUserOperation} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import {Calldata} from "@openzeppelin/contracts/utils/Calldata.sol";
import {PaymasterCore} from "./PaymasterCore.sol";
import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol";

Expand All @@ -26,7 +24,7 @@ import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol";
abstract contract PaymasterSigner is AbstractSigner, EIP712, PaymasterCore {
using ERC4337Utils for *;

bytes32 internal constant _USER_OPERATION_REQUEST =
bytes32 private constant USER_OPERATION_REQUEST_TYPEHASH =
keccak256(
"UserOperationRequest(address sender,uint256 nonce,bytes initCode,bytes callData,bytes32 accountGasLimits,uint256 preVerificationGas,bytes32 gasFees,uint256 paymasterVerificationGasLimit,uint256 paymasterPostOpGasLimit,uint48 validAfter,uint48 validUntil)"
);
Expand All @@ -45,7 +43,7 @@ abstract contract PaymasterSigner is AbstractSigner, EIP712, PaymasterCore {
_hashTypedDataV4(
keccak256(
abi.encode(
_USER_OPERATION_REQUEST,
USER_OPERATION_REQUEST_TYPEHASH,
userOp.sender,
userOp.nonce,
keccak256(userOp.initCode),
Expand Down

0 comments on commit 03a756c

Please sign in to comment.