Example: Re-simulate existing Transaction
In this example, we'll walk through how to re-simulate a transaction that initially failed due to a problem in the calldata.
Step 1: Find the Transaction
To start, open Walnut and use the search to find the transaction with the following hash: 0x04e9aaf268efe3fd9a328f5d40867231dfae14549126db8ed5471d3b3ed4da78
Step 2: Inspect the Transaction Result
The transaction has reverted with the following error message: "Number must be greater than 0"
The error originates from the is_positive
function, which expects a positive number but instead received 0
. This indicates the transaction failed because an invalid argument (0
) was passed.
Step 3: Analyze the Calldata
The input params reveals that the problematic value is 0x0
, which corresponds to the number 0
in decimal. This value was passed as an argument to the is_positive
function, violating its requirement for the number to be greater than zero.
Step 4: Re-Simulate the Transaction
To resolve the issue, we modify the calldata by replacing the invalid value 0x0
with a valid positive number, such as 0x5
. This change satisfies the is_positive
function's requirement. Other parameters remain unchanged because they are correct and unrelated to the error. Focusing only on the problematic value avoids introducing new issues. Click "Run Simulation" to execute the transaction with the updated calldata.
Step 5: Check the Simulation Result
After running the simulation with the updated calldata, the transaction succeeds. The error is resolved because the modified argument (0x5
) satisfies the is_positive
function's requirement. Check the simulation results link.