Prepare for the Blockchain Developer Certification. Master blockchain concepts with flashcards and multiple choice questions. Explanation-based learning for your success!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What happens if the gas limit is exceeded during smart contract execution?

  1. The execution continues until the contract is finished.

  2. The execution is terminated, and all changes are reverted.

  3. The contract automatically adjusts the gas limit.

  4. All used gas is charged to the user regardless of completion.

The correct answer is: The execution is terminated, and all changes are reverted.

When executing a smart contract, if the gas limit is exceeded, the execution is terminated, and all changes made during that execution are reverted. This mechanism is in place to ensure that the state of the blockchain remains consistent and is not inadvertently altered by incomplete or failed transactions. The gas system is designed to prevent infinite loops and excessive resource consumption. If a transaction exceeds the predefined gas limit set for it, the Ethereum Virtual Machine (EVM) stops execution immediately. It prevents any modifications made during that transaction from being permanently recorded, ensuring that users do not unintentionally incur losses from uncompleted operations. This aspect is crucial for maintaining the integrity and reliability of smart contracts, as it protects users from potential pitfalls that could arise from deducting resources without producing a successful outcome.