Docs · Source
CONTRACTS
The whole protocol, readable. 15 files, 3,717 lines, 148.2 KB — highlighted at build time, served as static HTML.
The repository is private, so there are no "view on GitHub" links — every file here is served from this site instead.
src/
- ERC6551Registry.solThe canonical ERC-6551 registry used to derive and deploy Seat accounts.58 lines2.2 KB
- K401.solThe DN404 hybrid token. ERC20 + ERC721 mirror, 1e18 = 1 Seat, immutable 5% fee on mapped AMM pairs only. The mint and burn role lists are sealed one-way at deploy.439 lines17.5 KB
- K401BondDepository.solBonds. price = max(twap * (1 - discount), nav()) — floored at NAV, so no sale is ever dilutive.267 lines10.7 KB
- K401Buyback.solInverse bond. A standing, permissionless bid at rfv() - 1.5%, so the protocol quotes both sides of backing.109 lines4.4 KB
- K401Distributor.solEpoch emission. rate = R_MAX * clamp((P - 1) / (K - 1), 0, 1) — exactly zero at or below NAV.197 lines7.5 KB
- K401FeeSplitter.solSplits the 5% fee stream 50/30/15/5 and decays the team share linearly to zero over 30 days. The fee sale is floored at the TWAP, not at whatever the caller asks for.196 lines8.0 KB
- K401Lens.solRead-only aggregator. Batches the reads the frontend needs into single calls.271 lines9.8 KB
- K401Oracle.solFail-closed TWAP on the canonical 401K/USDG pair. Valid window 30 minutes to 4 hours, else StaleOracle().148 lines5.3 KB
- K401Seat6551.solERC-6551 token bound accounts for Seats. Salted with the Seat generation, so a recycled tokenId never inherits the old account. Lazily deployed, 0 fee to withdraw, ever.253 lines10.5 KB
- K401SeatRegistry.solThe game layer: tier, multiplier, mode, stock slots. Tier persists through transfer. upgrade() and fuse().433 lines16.9 KB
- K401Staking.sol"On the Clock". An additive per-share accumulator, lazy materialize(), 24h clock-out cooldown that can be cancelled. Seats are locked, not burned.303 lines11.7 KB
- K401StockDesk.solRWA acquisition. Batched buys with a hard 300 bps slippage ceiling measured against a fresh feed; distributes equities pro-rata by multiplier.339 lines14.7 KB
- K401Treasury.solTwo-bucket reserve. Bucket A is USDG and enforces rfvPerToken() >= 1e18; Bucket B holds tokenized equities, marked through fresh price feeds only and one-way in.314 lines12.9 KB