Skip to content

Commit 03a756c

Browse files
authored
Typehash: constant private with _TYPEHASH suffix (#76)
1 parent abc2ff6 commit 03a756c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

contracts/account/paymaster/PaymasterCore.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity ^0.8.20;
44

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

98
/**
109
* @dev A simple ERC4337 paymaster implementation. This base implementation only includes the minimal logic to validate

contracts/account/paymaster/PaymasterSigner.sol

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
pragma solidity ^0.8.20;
44

5-
import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol";
6-
import {ERC4337Utils} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
5+
import {ERC4337Utils, PackedUserOperation} from "@openzeppelin/contracts/account/utils/draft-ERC4337Utils.sol";
76
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
8-
import {Calldata} from "@openzeppelin/contracts/utils/Calldata.sol";
97
import {PaymasterCore} from "./PaymasterCore.sol";
108
import {AbstractSigner} from "../../utils/cryptography/AbstractSigner.sol";
119

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

29-
bytes32 internal constant _USER_OPERATION_REQUEST =
27+
bytes32 private constant USER_OPERATION_REQUEST_TYPEHASH =
3028
keccak256(
3129
"UserOperationRequest(address sender,uint256 nonce,bytes initCode,bytes callData,bytes32 accountGasLimits,uint256 preVerificationGas,bytes32 gasFees,uint256 paymasterVerificationGasLimit,uint256 paymasterPostOpGasLimit,uint48 validAfter,uint48 validUntil)"
3230
);
@@ -45,7 +43,7 @@ abstract contract PaymasterSigner is AbstractSigner, EIP712, PaymasterCore {
4543
_hashTypedDataV4(
4644
keccak256(
4745
abi.encode(
48-
_USER_OPERATION_REQUEST,
46+
USER_OPERATION_REQUEST_TYPEHASH,
4947
userOp.sender,
5048
userOp.nonce,
5149
keccak256(userOp.initCode),

0 commit comments

Comments
 (0)