Paymaster Errors

A guide to common errors for Stackup's ERC-4337 paymaster

General error messages

Stackup's paymaster parses User Operation data before approving to sponsor gas.

MessageDescription
-32521
Execution reverted
The paymaster simulated the user operation to estimate the gas cost and found that the execution will revert.

To troubleshoot this error, we recommend double-checking the logic that you used to create the user operation's callData. If you are batching calls, test each call separately to identify the culprit. If you are unable to quickly identify the issue, you may need to simulate the user operation.
userOp: invalid senderThe sender field of the user operation is not a valid address.
userOp: invalid nonceThe nonce field of the user operation is not in a valid format.
userOp: invalid initCodeThe initCode field of the user operation is not in a valid format.
userOp: invalid callDataThe callData field of the user operation is not in a valid format.
userOp: invalid callGasLimitThe callGasLimit field of the user operation is not in a valid format.
userOp: invalid verificationGasLimitThe verificationGasLimit field of the user operation is not in a valid format.
userOp: invalid preVerificationGasThe preVerificationGas field of the user operation is not in a valid format.
userOp: invalid maxFeePerGasThe maxFeePerGas field of the user operation is not in a valid format.
userOp: invalid maxPriorityFeePerGasThe maxPriorityFeePerGas field of the user operation is not in a valid format.
userOp: invalid paymasterAndDataThe paymasterAndData field of the user operation is not in a valid format.
userOp: invalid signatureThe signature field of the user operation is not in a valid format.
userOp: incorrect number of fieldsThe user operation does not contain the expected number of fields.
params: not a valid tuple of UserOperation and EntryPoint addressThe parameters sent with pm_sponsorUserOperation is not in the expected format.
entryPoint: not a valid addressThe Entry Point address in the pm_sponsorUserOperation call is not valid.

Paymaster RPC errors

An overview of custom JSON-RPC error responses related to the Paymaster API.

CodeMessageDescription
-32031simulation: insufficient token paymentsSimulation has failed to show that the paymaster was compensated a sufficient amount of tokens for an erc20token call to pm_sponsorUserOperation. Ensure that the paymaster address has been approved for an appropriate amount.