What Is the Role of the ‘EVM’ (Ethereum Virtual Machine) in Gas Consumption?
The EVM is the runtime environment for smart contracts. It executes the contract code by processing a sequence of opcodes.
Each opcode has a pre-defined gas cost. The EVM calculates the total gas consumption by summing the cost of all opcodes executed during the transaction, enforcing the gas limit.