Understanding Gas Fees
Gas fees are transaction fees required to execute operations on Ethereum and its Layer 2 networks. Most blockchains require some type of transaction fee in order to add information to the chain. These fees are paid in ETH and go directly to network miners or validators as a reward for securing the blockchain and confirming transactions.
Some argue that without fees, blockchains could quickly become too large to manage due to the absence of a deterrent against spamming them with data. This could compromise the network's decentralization, as not all nodes would have the capability to store such a vast amount of information.
Why Do Failed Transactions Still Cost Gas?
The key point to understand is that gas fees are essentially charges for computational efforts undertaken by the network. Whether the transaction succeeds or fails, these computational resources are still consumed.
"Everything added to a blockchain, including the record of a failed transaction, consumes both space and validator resources. In other chains that still use mining, this work would require miner resources. All these operations require computational power, and therefore, a fee is charged, regardless of whether the transaction succeeds or fails.
A distinction should be made between failed transactions and transactions that were never created. A failed transaction is one that was initiated and has a transaction hash (tx) but was not successfully executed. Despite its failure, it is still recorded on the blockchain and incurs a gas fee. On the other hand, a transaction that was never created was never broadcast to the blockchain. For example, if you confirm a swap in your wallet, but your internet connection goes off just at that moment, the blockchain will never know that you intended to initiate that transaction. Since it was never broadcast to the network, no fees are incurred.
Common Reasons for Failed Transactions
Out of Gas: This happens when the gas limit set for the transaction is too low to complete the operation. Solution: Increase the gas limit for subsequent transactions.
Bad Instruction or Reverted: These are typically more complex failures and could result from conditions set within a smart contract or by the project team behind a token. Solution: You'll need to consult the documentation or reach out to the project team for resolution.
How to Investigate?
You can check the status and reason for your transaction failure, along with the gas fee, on each blockchain's Block Explorer. If you need assistance with investigating a transaction that originated on Slingshot, our team will gladly assist you once you provide us with the transaction hash. However, we strongly encourage you to first try investigating the cause yourself so that you can 1) learn more about blockchains, transactions, and how they function and 2) so that you can provide some initial details to our team so that we can better assist you.