Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofgazso committed Mar 6, 2024
1 parent 79f0d99 commit 6a0f602
Show file tree
Hide file tree
Showing 3 changed files with 550 additions and 4 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ solc = "0.8.23"
optimizer = true
optimizer_runs = 1000000
gas_price = 1000000000
gas_reports = ["ERC20Paymaster"]
8 changes: 4 additions & 4 deletions src/ERC20Paymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "./interfaces/IOracle.sol";
import "@account-abstraction/contracts/core/EntryPoint.sol";
import "@account-abstraction/contracts/core/UserOperationLib.sol";
import "./utils/SafeTransferLib.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "./utils/SignatureCheckerLib.sol";

using UserOperationLib for PackedUserOperation;

Expand All @@ -22,7 +22,7 @@ using UserOperationLib for PackedUserOperation;
/// It also allows updating price configuration and withdrawing tokens by the contract owner.
/// The contract uses an Oracle to fetch the latest token prices.
/// @dev Inherits from BasePaymaster.
///
/// @custom:security-contact security@pimlico.io
contract ERC20Paymaster is BasePaymaster {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
Expand Down Expand Up @@ -200,7 +200,7 @@ contract ERC20Paymaster is BasePaymaster {
uint48 validAfter = uint48(bytes6(paymasterConfig[26:32]));

if (
!SignatureChecker.isValidSignatureNow(
!SignatureCheckerLib.isValidSignatureNowCalldata(
guarantor, getHash(userOp, validUntil, validAfter, 0), paymasterConfig[32:]
)
) {
Expand All @@ -225,7 +225,7 @@ contract ERC20Paymaster is BasePaymaster {
}

if (
!SignatureChecker.isValidSignatureNow(
!SignatureCheckerLib.isValidSignatureNowCalldata(
guarantor,
getHash(userOp, validUntil, validAfter, uint256(bytes32(paymasterConfig[0:32]))),
paymasterConfig[64:]
Expand Down
Loading

0 comments on commit 6a0f602

Please sign in to comment.