Skip to main content

How Does the ‘Out-of-Gas’ Error Impact a Smart Contract Transaction’s State Change?

An 'out-of-gas' error occurs when the user-specified gas limit for a transaction is insufficient to complete all the smart contract operations. When this happens, the transaction fails, and all state changes that occurred during the execution are reverted.

However, the user still pays the gas fee for the computational work that was performed before the failure, as the validators expended resources.

How Does EIP-1559 Affect Gas Fee Calculation?
What Is a “Gas Fee” and How Is It Related to Transaction Nonces?
What Happens When a Transaction Runs out of Gas?
Why Do Users Still Set a ‘Max Fee’ Even with a Dynamic ‘Base Fee’?