Overview
Gas is the unit used to measure the computational effort required to execute operations on the Ethereum blockchain. The gas limit acts as a safety mechanism to prevent infinite loops or excessive resource consumption.
How it Works
- Standard Transfer: Usually requires a fixed amount of gas (e.g., 21,000).
- Smart Contracts: Require varying amounts depending on the complexity of the code.
- Unused Gas: If a transaction uses less gas than the limit, the remaining gas is returned to the sender. If it hits the limit, the transaction fails but the fee is still kept by the validator.