Ether and Gas

Gas and Gas Limit

Beginner Level

Gas is the unit that measures the computational effort required to execute transactions or smart contracts on the Ethereum network.

  • Gas: Unit that measures computational effort required to execute transactions or smart contracts.
  • Gas limit: Maximum gas a sender is willing to spend for a transaction.
  • Gas price: Amount of Ether per unit of gas (gwei).

Transaction fee:

Transaction Fee = Gas Used × Gas Price

Key points:

  • Complex computations or storage writes consume more gas.
  • Running out of gas reverts the transaction, but gas spent is not refunded.

Continue Learning

Explore more topics in Solidity or browse other tutorials.