Patterns for Smart Contract Developers
Contract patterns are reusable solutions to common on-chain problems: checks-effects-interactions, pull payments, access control, pausable and proxy upgrade patterns. Gas optimisation is the practice of lowering transaction cost through storage packing, fewer storage writes and efficient data types. Both aim at contracts that are safe and affordable to use.
Stage: Standards and Patterns · Part of the Smart Contract Developer roadmap · Last reviewed 19 November 2026
What to learn in Patterns
- Order code as checks, effects, then interactions to avoid reentrancy
- Use pull payments so users withdraw funds rather than being sent them
- Apply role-based access control with Ownable or AccessControl
- Explain how upgradeable proxies work and the storage risks they bring
- Reduce gas by packing variables and caching storage reads in memory
Patterns interview questions
What is the checks-effects-interactions pattern?
Validate conditions first, update your own state second, and make external calls last. Because state is already updated when control passes to another contract, a reentrant call cannot exploit stale values such as an unreduced balance.
Why are storage writes expensive and how do you reduce them?
Writing to a storage slot is among the costliest EVM operations because the change is kept by every node forever. Reduce them by packing small variables into one slot, reading a value into memory once, and avoiding unnecessary updates.
Where Patterns fits in the Smart Contract Developer roadmap
Patterns belongs to the Standards and Patterns stage (intermediate level), which takes about 25 hours. Real contracts.
Other units in this stage
Back to the full Smart Contract Developer roadmap