Architecture overview
Foundry project, Solidity 0.8.28 (via-IR), OpenZeppelin 5.x. Every index launch is a pair of cheap contracts (an EIP-1167 clone + a tiny treasury) wired to four shared singletons.
Contract inventory
| Contract | Kind | Role |
|---|---|---|
FeeRegistry | Singleton | Governance config: reserve asset (USDG), router, protocol treasury, launch fee, fee cap, stock allow-list, guardian pause |
IndexFactory | Singleton | Permissionless launchpad — clones the token, deploys the RFV treasury, mints 1%/99% |
FeeProcessor | Singleton | Permissionless fee conversion: swap → split → buy stocks → distribute |
Treasury | Singleton | Interim protocol fee sink (Ownable2Step; migrates to the $IPAD-redeemable ProtocolTreasury later) |
IndexToken | Per index (clone) | Fixed-supply fee-on-transfer ERC-20 with the embedded keeper-free dividend accumulator |
IndexTreasury | Per index | RFV vault: accrues USDG, redeem() burns tokens for pro-rata reserve — see RFV & redemption |
FeeToken | Base (abstract) | Fee-on-transfer base: immutable fees, AMM-pair registry, releaseFees() |
ProtocolToken / ProtocolTreasury | In repo, not deployed | Future $IPAD token + redeemable treasury — the migration target once $IPAD launches |
Protocol constants
All in libraries/Constants.sol, enforced on-chain:
| Constant | Value | Meaning |
|---|---|---|
MAX_FEE_BPS | 1000 | Hard cap on buy/sell fee (10%) — per-token fees immutable after launch |
PROTOCOL_SHARE_BPS | 1000 | 10% of every converted fee → protocol treasury (fixed) |
NON_PROTOCOL_BPS | 9000 | The creator-splittable pool: rfvShareBps + distribution share |
DEFAULT_RFV_SHARE_BPS | 1500 | UI default: 15% RFV / 75% holder distribution |
LAUNCH_PROTOCOL_BPS | 100 | 1% of supply minted to the protocol at launch |
MAX_BASKET_SIZE | 16 | Gas bound on the O(N) accumulator |
Trust model
- Immutable per token: fees, basket,
rfvShareBps, supply. The creator's only post-launch power is registering genuine AMM pairs. - Governance (registry owner): the stock allow-list, router, treasury addresses, launch fee, and a guardian pause (blocks new launches and conversions — never claims or RFV redemptions).
- Nobody: can mint, change a fee, touch the RFV reserve, or block a holder's
claim/redeem.
Off-chain stack (optional, non-trusted)
| Component | Where | Notes |
|---|---|---|
| Indexer (Ponder + Postgres) | Railway | Read-only event indexing for the app — API reference |
| Web app (Next.js + wagmi/viem) | Vercel | UI only; every action is a direct wallet transaction |
Convert poker (keeper/) | anywhere | Optional cron that calls the permissionless convert() — no special rights |