Skip to main content

What Happens If a Transaction Runs out of Gas before Completion?

If a transaction runs out of gas (i.e. the computational cost exceeds the user-set gas limit), the transaction fails, and all state changes are reverted. Crucially, the user still pays for the gas consumed up to the point of failure.

This mechanism prevents malicious actors from draining network resources with endless computations and ensures validators are compensated for the work they performed.

What Happens to a Transaction If the Price Movement Exceeds the Set Slippage Tolerance?
What Is the Concept of ‘Revert’ in Smart Contract Execution?
What Happens When a Transaction Runs out of Gas?
Why Is the Consumed Gas Not Refunded upon Transaction Failure?