eth-infinitism/account-abstraction

Is the tokenPaymaster over prefund?

Closed this issue · 1 comments

In my mind, requiredPreFund from EntryPoint includes fund for postOp.

  • IPaymaster(paymaster).validatePaymasterUserOp{gas: mUserOp.paymasterVerificationGasLimit}(
    op,
    opInfo.userOpHash,
    requiredPreFund
    )
  • function _getRequiredPrefund(
    MemoryUserOp memory mUserOp
    ) internal pure returns (uint256 requiredPrefund) {
    unchecked {
    uint256 requiredGas = mUserOp.verificationGasLimit +
    mUserOp.callGasLimit +
    mUserOp.paymasterVerificationGasLimit +
    mUserOp.paymasterPostOpGasLimit +
    mUserOp.preVerificationGas;
    requiredPrefund = requiredGas * mUserOp.maxFeePerGas;
    }
    }

Why should we add additional (refundPostopCost * maxFeePerGas) above requiredPreFund here?

the calculation was updated with v0.7 with the new paymaserVerificationGasLimit