Solidity Basics
Solidity expresses persistent smart-contract state and externally callable functions for the EVM.
Solidity code often controls assets directly, so developers must reason about adversarial callers, storage, access control, and external calls.
The Intuition
A Solidity contract is a public machine with buttons. Anyone can press public buttons, and the machine keeps state between presses.
See it concretely
A transparent vending machine in a public square follows its printed rules exactly. If the rules are wrong, anyone can exploit them.
Tempting — but wrong
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 + adversarialTestingCheck your understanding
Are Solidity private variables cryptographically private?
Click to reveal answer
Why are external calls dangerous?
Click to reveal answer
- Define ABI, storage, memory, calldata, and events.
- Explain visibility and access control.
- Identify external call risks.
- Explain why contracts must be tested adversarially.
Which Solidity assumption is dangerous?