πŸŒ‰Paymaster Interfaces

  function validatePaymasterUserOp
    (UserOperation calldata userOp, bytes32 userOpHash, uint256 maxCost)
    external returns (bytes memory context, uint256 validationData);

function postOp
    (PostOpMode mode, bytes calldata context, uint256 actualGasCost)
    external;

enum PostOpMode {
    opSucceeded, // user op succeeded
    opReverted, // user op reverted. still has to pay for gas.
    postOpReverted // user op succeeded, but caused postOp to revert
}
// add a paymaster stake (must be called by the paymaster)
function addStake(uint32 _unstakeDelaySec) external payable

// unlock the stake (must wait unstakeDelay before can withdraw)
function unlockStake() external

// withdraw the unlocked stake
function withdrawStake(address payable withdrawAddress) external

To handle the transactions sponsored by paymasters, the entry point has to maintain a specific deposit mechanism, which is distinct from the staking system. This deposit serves as a pool from which UserOperation expenses are debited.

Below is the outline for the interface the entry point needs to support, aiding paymasters and, if necessary, accounts in handling their deposits: interface EntryPointDepositManagement {

} This interface allows for:

  • Depositing funds to the EntryPoint.

  • Withdrawing funds from the EntryPoint.

  • Checking the deposit balance of any paymaster or account.

The separation of deposit (for transaction costs) and stake (locked funds to ensure compliance) ensures a dual layer of financial security and transaction guarantee for the system.

Last updated