# Solidity Level 10: Gas & EVM Efficiency

> Level 10: Gas & EVM Efficiency of the LoWisa Solidity course: Gas Model, Storage and Execution Costs, Optimising Without Sacrificing Safety. 3 lessons and 9 ideas, each explained in one line.

Gas & EVM Efficiency is level 10 of 17 of the [LoWisa Solidity course](/courses/solidity/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Gas Model

- **Gas mechanics.** Every opcode costs **gas**: the transaction pays computation, memory and storage as it goes.
- **Storage dominates.** **SSTORE** dominates cost: a storage write outweighs thousands of arithmetic ops.
- **Refunds and zeroing.** Zeroing storage earns partial **refunds**: cleanup priced into the protocol.

## Storage and Execution Costs

- **Packing and caching.** Costs fall by **packing** slots and caching storage reads into memory locals.
- **Calldata over memory.** External inputs stay in **calldata**: the cheapest data location for read-only arguments.
- **Batching.** **Batching** amortises fixed overhead: one transaction settling many operations.

## Optimising Without Sacrificing Safety

- **Measure gas.** Gas work starts with **reports**: per-function costs measured in the test suite, tracked per commit.
- **Readability guard.** An optimisation that obscures an **invariant** is a net loss: audits cost more than gas.
- **Optimiser settings.** The compiler **optimiser** tunes for deploy versus runtime cost: a setting chosen, not defaulted.

## Before and after this level

- **Before:** [Level 9: Smart Contract Security](/courses/solidity/level-9-smart-contract-security/): Reentrancy and External Calls, Access and Economic Attacks, Secure Contract Patterns.
- **Next:** [Level 11: Testing](/courses/solidity/level-11-testing/): Unit and Integration Tests, Fuzz and Invariant Testing, Testing Adversarial Conditions.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Solidity Level 10: Gas & EVM Efficiency cover?

Gas Model, Storage and Execution Costs, Optimising Without Sacrificing Safety: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 9: Smart Contract Security, which covers Reentrancy and External Calls, Access and Economic Attacks, Secure Contract Patterns.

## Learn Solidity on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/solidity/level-10-gas-and-evm-efficiency/ · Updated 2026-11-30
