Skip to main content
Uruguay Can

News from across crypto

Gas Used on a Failed Ethereum Transaction: Receipt and Fee

How to check gas used on a failed Ethereum transaction: find gasUsed in its receipt, then multiply by effectiveGasPrice to calculate the fee paid.

Uruguay Can Editorial

Gas Used on a Failed Ethereum Transaction: Receipt and Fee

To check the gas used by a failed Ethereum transaction, open its transaction receipt in a block explorer and read Gas Used; that value records the work consumed before the transaction reverted.

If the failed transaction was a KyberSwap swap, you can inspect it the same way as any other Ethereum transaction. For more on how failed KyberSwap swaps incur revert costs, see our explanation of what a revert can cost; the receipt shows the actual gas used and fee for your transaction.

Find gas used in the transaction receipt

Copy the transaction hash from your wallet’s activity and open it in an Ethereum block explorer such as Etherscan. The hash identifies the transaction, including its status and receipt.

  1. Open the transaction page using the hash.
  2. Confirm the receipt status is failed, then find Gas Used. The receipt’s gasUsed value is measured in gas units.
  3. Find Effective Gas Price in the receipt. For post-London Ethereum transactions, the receipt reports this as effectiveGasPrice.

Keep Gas Used separate from the gas limit. The limit is the maximum gas the transaction was allowed to consume; gas used is what it actually consumed before failing. A failed transaction can use less than its limit, so the limit alone won’t tell you the fee paid.

Multiply gas used by the effective gas price

Calculate the fee as gasUsed × effectiveGasPrice. The price is often shown in gwei, so convert it to ETH per gas for the multiplication: 1 gwei equals 0.000000001 ETH.

Say the receipt shows 50,000 gas used and an effective gas price of 20 gwei. Multiply 50,000 by 0.000000020 ETH per gas to get 0.001 ETH. That is the transaction fee for the failed attempt, not the gas limit expressed as a fee.

Use the receipt’s values for the specific transaction you are checking. A failed KyberSwap swap follows the same calculation: its receipt gives the gas used and effective gas price needed to work out the actual fee.