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.
- Click "Insert Any Address"
- Paste the EntryPoint contract address into the input field (copy the contract address β)
- Select your blockchain from the dropdown menu
- Select "Choose function and parameters"
- Select
simulateHandleOp
from the dropdown menu - Paste the user operation you want to debug into the
tuple
field. - 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.
Updated 12 months ago