lessonΒ·20 minΒ·Chapter 2 of 3
The EVM & Gas
The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts. Every node runs the EVM, executing the same bytecode and reaching the same state. Gas is the unit measuring computational effort β each operation (OPCODE) costs a specific amount of gas. Users set a gas limit (max gas willing to spend) and a gas price (how much they pay per gas unit). If execution runs out of gas, the transaction reverts but the gas is still consumed. This mechanism prevents infinite loops and spam while fairly compensating validators.
π‘ Key Takeaway
This lesson covers the fundamental concepts. Make sure you understand these before moving to the next chapter.