Gas
Protocol
Unit measuring computational work in EVM transactions.
Gas quantifies how much computation and storage a transaction uses. Users pay gas fees based on gas used times gas price; efficient code and batching reduce gas costs.
Frequently asked questions
How is total gas fee calculated?
Total fee ≈ gasUsed × (baseFee + priority tip). On some L2s, fees include L1 data costs plus L2 execution.Why do my transactions fail with out‑of‑gas?
The gas limit was too low for execution. Estimate carefully and add margin; complex calls can vary based on on‑chain state.What affects gas prices?
Network demand, base fee (EIP‑1559), and your tip. Higher tips improve inclusion probability during congestion.