Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

NameTypeDescription
modePostOpMode
contextbytes
actualGasCostuint256the actual amount paid (by account or paymaster) for this UserOperation
actualUserOpFeePerGasuint256total gas used by this UserOperation (including preVerification, creation, validation and execution)

Enums

PostOpMode

enum PostOpMode {
    opSucceeded,
    opReverted,
    postOpReverted
}