eth-infinitism/account-abstraction

Without Paymaster, The balance is 0.9MATIC cannot be transferred 0.5MATIC

MR-Hzy opened this issue · 5 comments

MR-Hzy commented

Hello~~ When I use the abstract account, I found some unreasonable places

Here is userOp

{
    "sender": "0x45598C361a477a7bFcc59FACdD8b7c0ce51Caf32",
    "nonce": "0x2",
    "initCode": "0x",
    "callData": "0xb61d27f6000000000000000000000000d0297133b5dcec18af938da03f866dc3789589cd00000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
    "callGasLimit": "0x88b8",
    "verificationGasLimit": "0x11170",
    "preVerificationGas": "0x5208",
    "maxFeePerGas": "0x529b5f6db0",
    "maxPriorityFeePerGas": "0x7e498f300",
    "paymasterAndData": "0x",
    "signature": "0xd2517497983173992a70128e2c6999432267f3c7bcc155b477cc4635300631a17ff274470ce7ee267168014432bef6947193fc514e2c4e0889923acdf6d902871c"
}

When calling estimateUserOperationGas got the error message is execution reversed, even transferring 10 MATIC when the balance is 15MATIC cannot be successful.

I don't know if this is a bug or by design. Because when I transfe with pm, all the amount of transaction will be successful;

There is not enough information.
did you try it on some testnet?
can you share a sample code?

MR-Hzy commented

Of cource, my factory contract is verified at polygon scan.
contract SecAccountFactory
0x7A7DF81B5B0b68002867D77Ca4b10Cd13f52C325

use the erc-4337-examples of https://github.com/stackup-wallet/erc-4337-examples

code change is:

image

and

image

then i run the yarn simpleAccount address and yarn simpleAccount transfer -t 0xD0297133b5dCec18AF938dA03f866dc3789589CD -amt 0.5 and got the execution reversed.

i had debug the tx on my personal chain and got the error at

if (gasleft() < callGasLimit + mUserOp.verificationGasLimit + 5000) {
. the gasleft() < callGasLimit + mUserOp.verificationGasLimit + 5000 get true and whatever i set gas(use the same callData but not same gas), the gasleft is same here.

MR-Hzy commented

@drortirosh Hello~~ Is there any result?

Seems like an issue with the bundler implementation, not the contacts.
Did you check with other bundlers?

MR-Hzy commented

yeah it's call gas estimate by bundler code error. thank you.