Skip to content

Glossary

Factory Pattern

A contract whose only job is to deploy other contracts — typically via CREATE2 — so users get a separate contract instance per use case.

A factory contract deploys instances of some other contract type on demand. Uniswap v2's UniswapV2Factory deploys a new pair contract for each token pair; UniswapV3Factory deploys pool contracts per token pair and fee tier; Safe's ProxyFactory deploys new multisig wallet instances.

Factories typically use CREATE2 so the resulting addresses are deterministic and addressable before deployment. The pattern is how DeFi protocols scale to many instances (one pool per pair, one vault per asset) without each instance needing its own deployment infrastructure.