Skip to content

ERC-4337 Smart Wallet fails simulation for native value >100 POL on Polygon Mainnet #8846

Description

@Roongrote

Description

Hi Thirdweb team,

I'm encountering a strange issue with ERC-4337 Smart Wallet on Polygon Mainnet.

Transactions work perfectly up to 100 POL, but any transaction above 100 POL consistently fails during UserOperation simulation.

This happens even for a simple native payable contract call.


Environment

  • thirdweb SDK: v5.120.x
  • Chain: Polygon Mainnet (137)
  • Smart Wallet: ERC-4337
  • Bundler: Thirdweb
  • Paymaster: Thirdweb
  • Sponsor Gas: Enabled

Smart Wallet Flow

The transaction is simply:

deposit() payable

The contract is a wrapped POL contract.

The contract only contains:

function deposit() external payable {
    balanceOf[msg.sender] += msg.value;
}

There are:

  • no require()
  • no modifier
  • no onlyOwner
  • no blacklist
  • no custom revert

Code

const depositTx = prepareContractCall({
  contract: wpolContract,
  method: "function deposit() payable",
  params: [],
  value: requiredAmount,
});

await sendTransaction({
  account,
  transaction: depositTx,
});

I also tested:

sendBatchTransaction({
    account,
    transactions: [depositTx]
});

Both produce the same behavior.


Results

100 POL

✅ Success

  • UserOperation succeeds
  • Sponsored
  • deposit() executes
  • Wrapped token is minted

101 POL

❌ Failed

Bundler returns:

UserOperation reverted during simulation with reason: 0x

or

Internal server error

No transaction hash is produced.


Server Verifier

I implemented a custom Server Verifier.

It returns:

{
  "isAllowed": true,
  "reason": "Allowed"
}

The backend logs:

Sponsorship Allowed
Status: Allowed

Removing all business validation produces the same result.


Observations

  • 1 POL works
  • 10 POL works
  • 100 POL works
  • 101 POL fails
  • 200 POL fails
  • 1000 POL fails
  • 10000 POL fails

The Smart Wallet has enough POL balance.

Changing from sendBatchTransaction() to sendTransaction() does not change the result.

This appears to happen during:

eth_estimateUserOperationGas

before the transaction is actually executed.


Question

Is there any internal limit for native value in ERC-4337 sponsorship?

Or is this a known issue with Polygon Mainnet / ERC-4337 Bundler?

I'd appreciate any guidance.

Thank you.

Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions