Solia saysA factory deploys new instances and a registry tracks them — together they make per-user contracts discoverable, queryable, and indexable without an off-chain database.
The factory pattern is a contract whose only job is to deploy other contracts. The registry pattern tracks every instance the factory has produced. Combined, you get an on-chain phonebook: "show me every vault Alice owns," "list all marketplaces created last week," etc. Front-ends query the registry instead of replaying every InstanceCreated event.
Real-world examples: Gnosis Safe ProxyFactory + tracker, Uniswap V2 PairFactory, Aave reserve registry. The demo deploys three instances and queries them by owner and by type.
Power-ups you unlock
Factory: dedicated contract that deploys instances
Registry: tracks every instance the factory created
On-chain phonebook for per-user / per-collection contracts
Indexers can read the registry instead of replaying events
Used by Gnosis Safe, Uniswap, Aave, and many more
The Reentrancy Reaper attacks — common mistakes
Letting anyone deploy through the factory with no auth (spam)
Trusting an arbitrary contract calling registry.register() (use factory-only)
Storing too much per-instance metadata on-chain (bloat)
Skipping events on registration (breaks indexers)
Boss battleDeploy three instances via a factory, store them in a registry, then query by owner and by type.