Contracts Overview
These docs describe the production Set & Forgetti contract system.
Three-Layer Architecture
S&F uses a clean separation of concerns across three contract layers:
┌─────────────────────────────────────────────────────────────────────┐
│ USER ACTIONS │
│ deposit → stake shares → claim rewards → withdraw │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ LAYER 1: SFVault (ERC-4626) │
│ ───────────────────────────── │
│ • Accepts kitchen token deposits │
│ • Mints vault shares to depositors │
│ • Routes assets to strategy │
│ • Handles profit unlock (anti-sandwich) │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ LAYER 2: Strategy (Beradrome) │
│ ───────────────────────────── │
│ • Stakes assets in external protocols │
│ • Executes harvests (BGT + other rewards) │
│ • Converts yield to target reward token │
│ • Notifies MultiRewards of new rewards │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ LAYER 3: MultiRewards │
│ ───────────────────────────── │
│ • Stakes vault shares from users │
│ • Distributes rewards proportionally │
│ • Processes badge-based fee rebates │
│ • Supports multiple reward tokens │
└─────────────────────────────────────────────────────────────────────┘Contract Roles
| Contract | Primary Role | User Interaction |
|---|---|---|
| SFVault | Asset custody & share accounting | Deposit/withdraw kitchen tokens |
| Strategy | Yield generation & harvesting | None (keeper-operated) |
| MultiRewards | Reward distribution | Stake shares, claim rewards |
| BgtConverter | BGT wrapper minting | None (internal helper) |
User Flow
Deposit
User deposits kitchen tokens into SFVault and receives vault shares. Assets are automatically staked into the strategy.
// Deposit 100 kitchen tokens, receive vault shares
vault.deposit(100e18, userAddress);Stake Shares
User stakes vault shares in MultiRewards to become eligible for rewards.
// Stake all vault shares
multiRewards.stake(vaultShareBalance);Earn Rewards
Keepers periodically harvest yield through the Strategy. Rewards are converted and distributed to stakers proportionally.
Claim & Withdraw
Claim rewards anytime. Withdraw principal anytime (even when deposits are paused).
// Claim accumulated rewards
multiRewards.getReward();
// Withdraw kitchen tokens
vault.withdraw(amount, userAddress, userAddress);Contract Details
- SFVault — ERC-4626 vault interface
- Strategy — Harvest and yield mechanics
- MultiRewards — Staking and reward distribution
