Memecoin trading 2 min read

Use an ETH explorer to read a failed token swap

Distinguish a pending hash, a failed mined receipt and a successful execution, then check the actual gas paid.

Green and amber server lights next to a laptop in a dark room.
View the worked illustrationClose illustration

Scroll the illustration to inspect the details.

This example uses ordinary Ethereum execution gas and excludes any separate transaction, token fee or special fee component.

A transaction hash identifies the transaction. By itself it does not prove inclusion or successful execution. On Ethereum, start with the correct network and hash. A mined transaction has a receipt with a block reference and execution status. A pending transaction has no mined receipt yet. A missing hash on one explorer can also mean the wrong network or an unobserved transaction.

Read status and the amount paid for execution

For a modern Ethereum receipt, status 0x0 means execution failed and status 0x1 means it succeeded. A failed on-chain swap can still consume gas. For a simple illustration, 50,000 gas used at an effective gas price of 20 gwei costs 1,000,000 gwei, or 0.001 ETH. Use gas used and effective gas price for the receipt, rather than multiplying the transaction’s maximum gas limit by its maximum advertised fee.

A failure normally reverts the state changes attempted by that transaction. An earlier successful approval is a separate transaction and can remain in force. Conversely, a successful approval does not prove that the following swap completed or delivered the token you expected.

Verify the result appropriate to your question

For a successful transaction, identify the called contract, the relevant token addresses and the actual balance changes or transfer logs. Block inclusion and later finality are different observations. Check the transaction stage before comparing a wallet’s balance with an exchange statement.

Use the approval and transfer example if the successful receipt was for an approval, not the intended swap.

JSON-RPC API · Transactions · Ethereum gas and fees: technical overview

Compare memecoin trading platformsOrder types, fees and supported networks

Read next

More from this space