IPaymaster
Interface for a paymaster contract that agrees to pay for the gas costs of a user operation. NOTE: A paymaster must hold a stake to cover the required entrypoint stake and also the gas for the transaction.
Functions
validatePaymasterUserOp
Validates whether the paymaster is willing to pay for the user operation. See IAccount-validateUserOp for additional information on the return value. NOTE: Bundlers will reject this method if it modifies the state, unless it's whitelisted.
function validatePaymasterUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 maxCost)
external
returns (bytes memory context, uint256 validationData);
postOp
Verifies the sender is the entrypoint.
function postOp(PostOpMode mode, bytes calldata context, uint256 actualGasCost, uint256 actualUserOpFeePerGas)
external;
Parameters
| Name | Type | Description |
|---|---|---|
mode | PostOpMode | |
context | bytes | |
actualGasCost | uint256 | the actual amount paid (by account or paymaster) for this UserOperation |
actualUserOpFeePerGas | uint256 | total gas used by this UserOperation (including preVerification, creation, validation and execution) |
Enums
PostOpMode
enum PostOpMode {
opSucceeded,
opReverted,
postOpReverted
}