Thomas Kelly
Thomas Kelly

Reputation: 103

Paymaster validation during ERC-4337 Gas Estimation phase

In my paymaster contract, I want to carry out validation (in _validatePaymasterUserOp) of the userop signature for certain operations. To do this I'm executing ECDSA.recover(ECDSA.toEthSignedMessageHash(userOpHash), op.signature) and comparing the result to an address I've stored in the contract.

However, during the gas estimation phase the signature is just some (recommended) dummy - given that the userOpHash can't be calculated until after estimating the gas and providing the gas figures in the userOperation.

How can I distinguish between gas estimate phase and actual validation phase during the execution of _validatePaymasterUserOp?

Upvotes: 1

Views: 25

Answers (0)

Related Questions