blockmindset
Lesson 2 of 515 min

Solidity Basics

Solidity expresses persistent smart-contract state and externally callable functions for the EVM.

Why this matters

Solidity code often controls assets directly, so developers must reason about adversarial callers, storage, access control, and external calls.

1

The Intuition

A Solidity contract is a public machine with buttons. Anyone can press public buttons, and the machine keeps state between presses.

2

See it concretely

Concrete example

A transparent vending machine in a public square follows its printed rules exactly. If the rules are wrong, anyone can exploit them.

3

Tempting — but wrong

4

The precise version

Solidity compiles to EVM bytecode and ABI metadata. Contracts define state variables, functions, modifiers, events, errors, and interfaces. Developers must understand storage versus memory versus calldata, visibility, access control, fallback and receive functions, reentrancy, delegatecall, upgradeability, and storage layout.

safeContract \approx correctLogic + accessControl + invariantProtection + adversarialTesting

Check your understanding

Are Solidity private variables cryptographically private?

Click to reveal answer

Why are external calls dangerous?

Click to reveal answer

Before moving on
  • Define ABI, storage, memory, calldata, and events.
  • Explain visibility and access control.
  • Identify external call risks.
  • Explain why contracts must be tested adversarially.
?Checkpoint

Which Solidity assumption is dangerous?