A gas limit is a permitted ceiling rather than a requirement to consume it.
LET’S PICTURE IT
Booking a maximum journey distance does not require the driver to travel unused kilometres.
SEE IT FOR YOURSELF
Calculate and split a manual execution feeStep 1 / 4
This example supplies twenty-one thousand gas used. It is a simple teaching input, not a live estimate of a contract call.
This example supplies twenty-one thousand gas used. It is a simple teaching input, not a live estimate of a contract call.With base ten Gwei, priority cap two and total cap twenty, the effective rate is twelve Gwei per gas.Twenty-one thousand times twelve Gwei gives two hundred fifty-two thousand Gwei, or 0.000252 ETH.The base-fee component is 0.00021 ETH and is burned. The priority component is 0.000042 ETH for the block fee recipient.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Execution can finish below its limit
A successful operation may consume fewer gas units than the transaction permits. Accounted gas consumption and effective price determine its execution-fee charge under the protocol rules.
Do not confuse unused allowance with refunds
Unused gasallowance is different from the protocol’s refund counter for particular state operations. Both can affect final accounting, but they arise through different mechanisms.
Maximum budget can overstate final cost
A wallet may show a maximum based on gas limit and fee cap. That figure is useful for affordability constraints, while the final receipt supplies actual consumption and effective price.
A failed operation needs precise context
Running out of gas and an explicit revert can have different remaining-gas behavior. Neither should be summarized as every failure refunds everything. Inspect the execution result and receipt rather than relying on the success label alone.