0
0
Blockchain / Solidityprogramming~5 mins

Ethereum Virtual Machine (EVM) in Blockchain / Solidity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the Ethereum Virtual Machine (EVM)?
The EVM is a virtual computer that runs smart contracts on the Ethereum blockchain. It executes code exactly as programmed, ensuring all nodes agree on the results.
Click to reveal answer
intermediate
How does the EVM ensure security and consistency?
The EVM runs code in a sandboxed environment, isolating it from the host system. It uses gas fees to limit resource use and prevent infinite loops, ensuring all nodes reach the same outcome.
Click to reveal answer
beginner
What is 'gas' in the context of the EVM?
Gas is a unit that measures the computational work required to execute operations on the EVM. Users pay gas fees to run smart contracts, which prevents abuse and compensates miners and validators.
Click to reveal answer
intermediate
Explain the role of bytecode in the EVM.
Smart contracts are compiled into bytecode, a low-level code the EVM understands and executes. This bytecode runs on every Ethereum node to maintain consensus.
Click to reveal answer
intermediate
What happens if a smart contract runs out of gas during execution?
If a contract runs out of gas, the EVM stops execution and reverts all changes made during that transaction. The user still pays for the gas used until that point.
Click to reveal answer
What does the EVM execute?
APython scripts
BJavaScript code
CSmart contract bytecode
DHTML pages
Why is gas used in the EVM?
ATo measure and pay for computation
BTo store data permanently
CTo create new Ethereum accounts
DTo speed up transactions
What happens if a transaction runs out of gas?
ATransaction completes successfully
BExecution stops and changes revert
CGas is automatically refilled
DThe contract code is deleted
Which environment does the EVM provide?
ASandboxed and isolated
BDirect access to hardware
CCloud-based only
DGraphical user interface
What language is typically compiled into EVM bytecode?
ARuby
BJava
CC++
DSolidity
Describe how the Ethereum Virtual Machine processes a smart contract transaction.
Think about how code runs, how resources are measured, and what happens if something goes wrong.
You got /5 concepts.
    Explain the importance of gas in the Ethereum Virtual Machine.
    Consider why running code on many computers needs a cost.
    You got /4 concepts.