Transaction Failed but Gas Was Charged: Where to See the Trace Results

 / 
1

The trace (call trace) of a failed transaction is not visible in the "Internal Txns" tab of block explorers. You need debugging tools that support simulation and tracing (such as Tenderly, Replay tools, or the revert.wtf browser extension). Etherscan displaying "Failed" only tells you the outcome; the trace tells you "at which step and for what reason it failed."

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

1. First, confirm: why you can't see the full trace on Etherscan

Etherscan's "Internal Txns" tab records ETH transfers that occur during the execution of a transaction. However, if the transaction fails as a whole (status shows "Failed"), the internal transactions may be incomplete or empty.

Etherscan's official documentation states that a failed transaction may fail due to "Out of Gas," "Bad Instruction," "Reverted," etc. The gas fee is still charged, but the transaction amount is refunded. If you want to know "exactly where the error occurred," Etherscan usually only shows one line like "Fail with error 'xxx'" and cannot restore the full call stack.

2. Practical steps: three ways to view the trace of a failed transaction

Step 1: Copy the failed transaction hash (TxHash)

  • What to do: From your wallet or a block explorer, copy the TxHash of the failed transaction.

  • How to do it: Go to the Etherscan transaction details page, the "Txn Hash" field is at the top, copy that string starting with 0x.

  • When you are done: You have a valid transaction hash in hand.

Step 2: Use Tenderly or Replay tools to view the full trace

  • What to do: Paste the TxHash into a debugging platform that supports transaction simulation, replay the execution and view the call stack.

  • How to do it:

    • Case A (using Tenderly): Go to Tenderly's Debugger page, paste the TxHash. The platform will automatically fetch transaction data and generate a visualized call stack, showing the execution status, gas consumption, and revert reason at each step.

    • Case B (using the revert.wtf browser extension): After installing the revert.wtf extension, open a failed transaction page (Etherscan or Blockscout). The extension will automatically read the call trace (Blockscout provides the full internal call trace), decode the revert reason, and show which layer of the call caused the problem.

    • Case C (using open-source tools like eth-trace-inspector): If you have a technical background, you can use an open-source TypeScript library by passing the TxHash and Chain ID; it will automatically fetch the ABI and output a structured call stack and revert message.

  • When you are done: You see the specific call hierarchy of the failed transaction and can identify which contract, which method, and what condition caused the failure.

Step 3: View internal calls on Blockscout (instead of Etherscan)

  • What to do: If you don't want to use external tools, you can directly check the same transaction on the Blockscout block explorer.

  • How to do it: Paste the TxHash into Blockscout's search box, go to the transaction details page, and find the "Internal transactions" or "Trace" tab. The free version of Blockscout can read the full internal call trace (including inputs/outputs, gas consumption, and revert flags of each sub-call), a capability that Etherscan's free version does not offer.

  • When you are done: You see multi-level call records on Blockscout and can pinpoint the exact revert point.

Prerequisites: You do not need to connect a wallet or own any assets. You only need the TxHash of a failed transaction.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

3. Common failure reasons and how to identify them from the trace

Failure typeEtherscan displayWhat the trace showsWhat to do
Out of GasOut of GasgasUsed at a certain step is close to gasLimit, subsequent calls are aborted due to insufficient gasIncrease Gas Limit next time
Permission deniedFail with error 'Ownable: caller is not the owner'The call stack shows that msg.sender is not the contract's owner addressConfirm you're using the correct address
Contract validation failedFail with error 'STF' or a custom errorThe trace shows the exact location of the require or revert statementCheck if parameters meet the contract conditions
ERC-20 transfer failedERC-20 Token transfer might have failedThe trace shows the token contract's transfer method returned false or revertedCheck the destination address balance, whether the contract is paused

Risk reminder: The gas fee for a failed transaction is deducted, but that does not mean your funds were transferred. Etherscan explicitly states that for a failed transaction "the transaction amount will be refunded after the gas fee is deducted." The trace is only for investigating "why it failed" and cannot help you recover the gas fee already charged.

After completing the above steps, how do you confirm you found the cause of failure?

In the trace view of Tenderly or Blockscout, locate the first call node with the status "Reverted". The error message next to it is the direct cause that made the entire transaction fail. Next, adjust your parameters based on that error message (such as approval amount, recipient address, gas settings) or contact the corresponding contract's project team, instead of blindly retrying the same transaction.