Overview
Security posture, smart contract architecture, and operational safeguards for the DomFi protocol.
Smart Contract Architecture
The protocol consists of 10 upgradeable contracts deployed behind OpenZeppelin TransparentUpgradeableProxy instances, plus 6 non-upgradeable contracts. All contracts resolve each other through a central DomfiRegistry.
Upgrades are governed by DomfiTimelockOwner, which enforces role-based access control. ProxyAdmin manages all proxy upgrades.
CONTRACT ARCHITECTURE
TRADING FLOW
ORACLE
VAULT & LP
GOVERNANCE & INFRASTRUCTURE
See the Contract Reference for a full list of deployed addresses and roles.
Access Control
Four roles managed by DomfiTimelockManager:
| Role | Capabilities |
|---|---|
| Governor | Register contracts, add trading pairs, set fee schedules, admin operations |
| Developer | Claim accumulated dev fees |
| Manager | Set max open interest per pair |
| Deployer | Initial deployment only — not used for ongoing operations |
All governance operations are subject to a timelock delay via DomfiTimelockOwner.
Operational Safeguards
- Oracle verification: prices are verified on-chain by
DomfiVerifier. Only prices signed by a registered signer are accepted. - Price checks: exchange prices that stray from the market are dropped, no single exchange can dominate an asset's price, supply figures are cross-checked between sources, and a pair whose value fails a check is not published. See Oracle › Safeguards.
- Timelock governance — all contract upgrades and configuration changes pass through a timelock, preventing instant unilateral changes.
- Proxy separation —
ProxyAdminis a separate non-upgradeable contract, isolating upgrade authority from application logic.