Skip to main content
In this guide, we’ll investigate the root cause of transaction failure and verify the fix. We’ll look into a Uniswap transaction. This transaction attempts to swapExactTokensForTokens.
1
Paste the transaction hash in search of Tenderly dashboard
2
Transaction hash: 0xbe082dcc8ae59868f5b2330173902bb88c6643b5c2fdf0d8a9f43d03dbca0c36
3
Explore the error
4
The revert happened in swapExactTokensForTokens, checking a condition involving amountOutMin that is an input parameter. It reverted with the following error message: Error message: UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT
5
From the inputs section, we can see that amountOutMin had value 1102820622890207119.
6
7
Explore revert condition
8
Hop into the debugger view. Notice that require involves amounts[amounts.length - 1].
9
10
Evaluate the expression
11
To get the value of this expression, you can use Evaluate:
12
  • Make sure debugger is at the line of revert,
  • Paste the expression `amounts[amounts.length - 1],
  • press “Evaluate” button.
  • 13
    The value is: The value is 1029855063181377015.
    14
    15
    Obtain the value from call information
    16
    You can also extract the value of the expression in question by analyzing the function that produced the value:
    17
  • Move the debugger to the getAmountsOut from the Execution trace on the left
  • Find the output in the lower pane
  • Since the expression amounts[amounts.length - 1] gets the last element of the array, we conclude that the value in question is 1029855063181377015.
  • 18
    19
    Potential solution
    20
    This transaction would have succeeded if the value of amountOutMin was 1029855063181377015.
    21
    Verifying the solution
    22
    To verify the solution, click the “Re-Simulate” button:
    23
  • Paste the value 1029855063181377015 to the second argument
  • Click Simulate.
  • 24
    The simulation has succeeded, meaning we found the correct argument value.
    25
    Swap transactions are time-sensitive, they take into account the block.timestamp value. Simulations are by default executed on the original block and at the original timestamp. Only if you need custom block and timestamp values, you can use block header overrides for that purpose.