Skip to main content

What Is the Concept of ‘Revert’ in Smart Contract Execution?

A 'Revert' is a function that, when executed within a smart contract, immediately stops the contract's execution and undoes all state changes that occurred during that transaction. This is often triggered by an error, a security check failure, or a condition specified in the contract (e.g. insufficient funds).

While the state changes are undone, the consumed Gas is still paid.

How Does Network Consensus Ensure the Integrity of Smart Contract Execution?
What Is Gas in the Context of Smart Contract Execution?
What Is the Difference between a Smart Contract and a Traditional Contract?
What Role Do Gas Fees Play in Smart Contract Execution and Network Consensus?