Docs · Source
CONTRACTS
The whole protocol, readable. 30 files, 6,103 lines, 230.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.408 lines16.1 KB
- K401BondDepository.solBonds. price = max(twap * (1 - discount), nav()) — floored at NAV, so no sale is ever dilutive.238 lines9.4 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.186 lines7.0 KB
- K401FeeSplitter.solSplits the 5% fee stream 50/30/15/5 and decays the team share linearly to zero over 30 days.146 lines5.6 KB
- K401Lens.solRead-only aggregator. Batches the reads the frontend needs into single calls.265 lines9.4 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. Lazily deployed on first stock delivery. 0 fee to withdraw, ever.195 lines7.5 KB
- K401SeatRegistry.solThe game layer: tier, multiplier, mode, stock slots. Tier persists through transfer. upgrade() and fuse().384 lines14.7 KB
- K401Staking.sol"On the Clock". Index-based accrual, lazy materialize(), 24h clock-out cooldown. Seats are locked, not burned.250 lines9.3 KB
- K401StockDesk.solRWA acquisition. Batched buys with a hard max-slippage; distributes equities pro-rata by multiplier.307 lines13.0 KB
- K401Treasury.solTwo-bucket reserve. Bucket A is USDG and enforces rfvPerToken() >= 1e18; Bucket B holds marked tokenized equities.293 lines11.6 KB
src/interfaces/
script/
test/
- Base.t.solShared test fixture: deploys the system with mocks and funds the actors.271 lines10.4 KB
- BondsAndBuyback.t.solBond pricing floored at NAV, vesting, and the buyback bid at RFV - 1.5%.219 lines8.4 KB
- Emission.t.solEmission maths, including the assertion that the Distributor mints 0 when twap <= nav.143 lines5.1 KB
- FeeSplitter.t.solThe 50/30/15/5 split and the 30-day linear team decay.100 lines3.4 KB
- Invariants.t.solThe protocol-wide invariants from the spec, fuzzed.531 lines20.8 KB
- Lens.t.solThe read aggregator returns what the frontend expects.129 lines4.5 KB
- Registry.t.solTier upgrades, fuse(), stock slots, and that tier survives an NFT transfer.227 lines8.2 KB
- RfvInvariant.t.solThe one that matters most: rfvPerToken() >= 1e18 after every possible operation.245 lines7.5 KB
- Seat6551.t.solToken bound account deployment and that TBA contents survive a transfer.131 lines4.5 KB
- Smoke.t.solEnd-to-end happy path across every module.46 lines1.7 KB
- Staking.t.solClock in/out, index accrual, materialize() and the 24h cooldown.234 lines8.0 KB
- StockDesk.t.solBatched buys, the slippage guard, and pro-rata distribution by multiplier.158 lines5.8 KB