Why Do You Pay Gas for a Failed Transaction?
Gas pays for the computation a transaction consumes, not for its outcome. Even a reverted transaction executed real work — signature checks, balance reads, contract logic — up to the point it failed, and occupied block space along the way, so miners and the network are owed for that work. You pay the execution gas but not any transfers the failed transaction attempted (those never happen). On Base and Arbitrum the cost is usually a cent or less, which makes the lesson cheap; the fix is diagnosing the revert before resubmitting.
- ✓Gas bills computation performed — success and failure both consume it
- ✓A revert means state changes are undone, but the work done still gets billed
- ✓No token transfers occur in a failed transaction — only the gas is lost
- ✓Read the revert reason on the explorer before resubmitting the same transaction
What "gas" actually is paying for
Every operation a transaction performs costs gas units: verifying the signature, reading balances, running the contract's code. A failed transaction is not a transaction the network rejected for free — it ran until the contract hit a condition it could not satisfy (insufficient output after slippage, an allowance too small, a pool with no liquidity) and then reverted, undoing its state changes. The computation up to that revert already happened and already occupied block space. Billing only successful transactions would invite free spam: anyone could flood the network with guaranteed-to-fail calls at zero cost.
This is also why you do not pay the full intended action twice — the swap's token transfers never happened, so only the gas is lost. A $0.01 failure on Base is an annoyance; the same architectural rule on mainnet once cost a friend of mine $18 for a swap that reverted on a stale approval.
How to stop paying the same failure twice
Do not blindly re-sign — if the condition did not change, the identical transaction fails again. Look the hash up on Basescan or Arbiscan, decode the input and revert reason (steps in the Basescan guide), then fix the actual cause: raise slippage, complete the token approval, add the missing gas balance, or switch pool. The common causes and their fixes are catalogued in the failed-transaction guide.
Prevention is cheap: keep a small ETH buffer so transactions are not underfunded (the reserve math), and check the live tracker before bigger calls. Note that a stuck pending transaction is a different problem from a failed one — if your transaction is not reverting but never confirming, the same-nonce fix applies instead.