Simulating ERC-4337 User Operations with Tenderly

If the provided error codes aren't enough to identify an issue, you can use Tenderly to simulate the user operation and find the problem.

New Simulation

Once you have a Tenderly account, log into your Tenderly dashboard.

In the sidebar, click "Simulator", then click the button "New Simulation."

Select Parameters

You will see a Contract form and a Transaction Parameters form.

  1. Click "Insert Any Address"
  2. Paste the EntryPoint contract address into the input field (copy the contract address β†—)
  3. Select your blockchain from the dropdown menu
  4. Select "Choose function and parameters"
  5. Select simulateHandleOp from the dropdown menu
  6. Paste the user operation you want to debug into the tuple field.
  7. Click the "Simulate Transaction" button

See the Overview

Once the transaction has completed simulation, you will see an overview. You can see the different reverts and exactly where the transaction failed. The below example reverted in two places: when validating the sender's signature, and when making a call to the sender to execute the callData.

You can also check the Gas Profile tab to see how much gas is used on each call. This is particularly helpful if you receive an "OOG" or out-of-gas error.