12. Cyfrin Updraft: Solidity Storage Factory
Overview
Section titled “Overview”This Cyfrin Updraft segment continues directly from SimpleStorage (lesson 11). Its subject is a genuinely new idea: a contract can create other contracts. That unlocks a pattern — the factory — that shows up throughout real Ethereum systems, from token launchers to DEX pair deployers. As with lesson 11, the teaching is on Updraft; these notes frame what to take from it.
What you’ll build
Section titled “What you’ll build”A StorageFactory contract that deploys and keeps track of many SimpleStorage instances. It creates child contracts, stores their addresses, and calls into them — so you see how contracts compose, one contract holding and operating others.
Concepts to lock in
Section titled “Concepts to lock in”- Contract composition — a contract can hold a reference to another contract (by its type and address) and call its functions. This is how large systems are assembled from small pieces.
- The factory pattern — one contract that deploys standardized instances on demand and records them. Useful whenever you need many similar contracts (one per user, per pool, per token).
- Imports and inheritance — pulling in another contract’s code with
import, and the idea of building on existing contracts, which is exactly how you’ll use OpenZeppelin next. - Addresses as handles — deploying returns an address; storing and reusing it is how the factory keeps talking to its children.
What to bring back
Section titled “What to bring back”You should be able to explain how one contract deploys and then calls another, and why the factory pattern is useful. That “contracts calling contracts” intuition is essential for the token standards (lesson 10 / OpenZeppelin) and for everything in Modules 3–5.
Check yourself
Section titled “Check yourself”- What does the factory store so it can keep interacting with the contracts it creates?
- Give one real situation where deploying many similar contracts is the right design.
- How does
importhere relate to the way you’ll use OpenZeppelin’s ERC-20?
Open Course Segment
Section titled “Open Course Segment”Cyfrin Updraft: Solidity
Assignment: complete the Storage Factory chapter.
