# Solidity Level 2: State & Data Locations

> Level 2: State & Data Locations of the LoWisa Solidity course: Contract Storage, Memory and Calldata, State Mutation. 3 lessons and 9 ideas, each explained in one line.

State & Data Locations is level 2 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.

## Contract Storage

- **Storage.** **Storage** is the contract’s permanent state: slot-addressed, replicated on every node, expensive by design.
- **Slots.** State variables pack into 32-byte **slots**: layout order deciding real gas costs.
- **Cold and warm access.** First touch of a slot is **cold** and costlier: access patterns are money.

## Memory and Calldata

- **Memory.** **memory** is transient scratch space per call: cheap, wiped when the call ends.
- **calldata.** **calldata** is the read-only input bytes: the cheapest place for external function arguments.
- **Location keywords.** Reference parameters declare a **location**: storage, memory or calldata: semantics, not style.

## State Mutation

- **Transactions mutate.** State changes only inside **transactions**: atomic: all effects land or all revert.
- **Revert semantics.** A **revert** undoes every state change of the call: failure leaves no half-writes.
- **Checks-effects-interactions.** The safe order: **checks**, then effects, then interactions: state settled before any external call.

## Before and after this level

- **Before:** [Level 1: Solidity Foundations](/courses/solidity/level-1-solidity-foundations/): Types and Variables, Functions, Contract Structure.
- **Next:** [Level 3: Collections & Data Models](/courses/solidity/level-3-collections-and-data-models/): Arrays and Mappings, Structs and Enums, Designing Contract State.

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 2: State & Data Locations cover?

Contract Storage, Memory and Calldata, State Mutation: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 1: Solidity Foundations, which covers Types and Variables, Functions, Contract Structure.

## 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-2-state-and-data-locations/ · Updated 2026-11-30
