Skip to content

12. Cyfrin Updraft: Solidity Storage Factory

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.

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.

  • 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.

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.

  • 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 import here relate to the way you’ll use OpenZeppelin’s ERC-20?

Cyfrin Updraft: Solidity

Assignment: complete the Storage Factory chapter.

Open Solidity course on Updraft

Module 2: Solidity & Token Standards.