Blocky saysSolidity data lives in storage (persistent), memory (temporary), or calldata (read-only input).
Where a variable lives changes cost and behavior. storage persists on-chain (expensive, the contract's permanent state). memory is a temporary scratchpad cleared after the call (cheaper). calldata is the read-only, cheapest location for function arguments. Choosing the right location — e.g. calldata for external array params — is a key gas and correctness decision.
Power-ups you unlock
storage: persistent, expensive state
memory: temporary scratchpad
calldata: read-only function input, cheapest
Right location = gas + correctness
Double-Spend Dan attacks — common mistakes
Copying calldata to memory needlessly
Accidental storage references mutating state
Wrong data location causing compile errors
Boss battleChoose the data location for an external function’s array parameter and explain why.