Security Overview
How Yield Forge protects your funds — multiple layers of defense.
Security is built into every layer of Yield Forge. Here's how the protocol protects user funds.
Defense in Depth
Modular Architecture (Diamond Pattern)
Logic is split across separate facets. If a vulnerability is found in one module, it can be patched surgically — without migrating the entire protocol or touching user funds in other parts of the system.
Battle-Tested Libraries
Core functionality (ERC-20 tokens, access control, math) uses OpenZeppelin contracts — the most widely audited and used Solidity libraries in DeFi.
Reentrancy Protection
Every state-changing function is protected by a reentrancy guard that shares a single storage slot across all facets. This prevents cross-facet reentrancy attacks — a common vulnerability in Diamond-pattern contracts.
Adapter Whitelisting
Yield Forge only interacts with explicitly approved adapters and protocols. You can't register a pool with an unapproved adapter, and you can't use an unapproved quote token.
Timelock on All Upgrades
Every administrative action — upgrading a facet, approving a new adapter, changing fee recipients — must go through a 48-hour timelock. This gives users time to review pending changes and exit if they disagree.
Emergency Pause
A dedicated pause guardian can instantly halt operations if a threat is detected, without waiting for the timelock. See Access Control for details on who can do what.
What This Means for Users
- Your funds sit in the underlying protocol (Uniswap, Curve) — not in an admin-controlled wallet
- No single person can drain the protocol or change rules instantly
- You always have time to exit before any upgrade takes effect
- If something goes wrong, specific pools can be paused without affecting others
!IMPORTANT No protocol is 100% safe. Smart contract risk, underlying protocol risk, and economic risk all exist. Always do your own research and never deposit more than you can afford to lose.