Deviant BCH wallet — CashTokens + covenants (Katalogos v1 · chipnet)
Step 3+4 of the Anthemus critical path: - contracts/SharePairAmmV2.cash — fractional LP tokens via the reservoir model (outstanding = supply − treasury; add releases pro-rata, remove absorbs and pays the fee-grown slice) + Uniswap-V2-style fee-on-input invariant (k grows 0.30% per swap, 100% to LPs) + treasury-drain guard (swap barred from the treasury input; locking-bytecode pinning; no dust drain). 4/4 mock tests at exact fee/mint/withdraw boundaries. - scripts/chipnet-anthemus-amm-v2.mjs — 5/5 PASS live chipnet: bootstrap → fee swap (1,000→906) → LP release (exactly 1,000) → LP burn returning 1,100 X + 909 Y (fees included). Pool end-state exact. - services/anthemus-relay — curveLevels()/poolBook() + GET /pool: the AMM rendered as a maker on the SAME book (pool-as-maker path). - wiki/decisions.md — ADR-0049 written against the validated bytecode: brand locked, book-first ratified, ADR-0016 refined (hub-exclusive pools only), maker 0 / taker 0.15% consensus-enforced, curve fee 100%-to-LP with the protocol slice deferred, tollBps accepted-pending, USDu preferred-not-forced. - critical-path doc → rev. 2 (Steps 1–4 status). Mixed shared files staged as HEAD+own-edits blobs; the concurrent session's uncommitted work remains untouched in the working tree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| contracts | ||
| design | ||
| docs | ||
| KnowledgeBase | ||
| Parameters | ||
| public | ||
| scripts | ||
| services | ||
| shells | ||
| snapshots | ||
| spike | ||
| src | ||
| telegram-orderbook | ||
| test | ||
| wiki | ||
| .calibration-sweep.json | ||
| .catalytic-sweep.json | ||
| .env.example | ||
| .gitignore | ||
| .kac-extract.txt | ||
| .sim-athenae.json | ||
| adaptive-data.json | ||
| bch-history.json | ||
| bch-market.json | ||
| BCH_Token_Economy_Concept_Paper.md | ||
| bch_wallet_architecture.svg | ||
| CLAUDE.md | ||
| deviant_technical_spec_v2.7.md | ||
| package-lock.json | ||
| package.json | ||
| project-context.md | ||
| README.md | ||
| tsconfig.json | ||
| usdm-historical.json | ||
Deviant
BCH two-tier token economy platform. Pre-implementation. See BCH_Token_Economy_Concept_Paper.md for the full design.
Status
Bootstrap snapshot — protocol swap mechanism is the validation target.
Project map
| Path | Purpose |
|---|---|
BCH_Token_Economy_Concept_Paper.md |
Architecture spec, all [PROPOSED] claims |
CLAUDE.md |
Working agreement for Claude sessions |
src/ |
TypeScript wallet + token logic |
contracts/ |
CashScript source for Architecture A contracts |
test/ |
Unit tests (regtest) + integration plan (chipnet, mainnet) |
scripts/ |
Code-scan, snapshot, compile helpers |
wiki/ |
Living docs: architecture, decisions, testing strategy, code map |
snapshots/ |
Numbered progress snapshots |
Quickstart
npm install
npm run compile:contracts # produces artifacts from contracts/*.cash
npm run test:regtest # runs regtest suite
npm run scan # regenerates wiki/code-map.md
npm run snapshot # appends a new snapshot
Build priorities (active)
- Protocol swap mechanism — most novel claim, needs validation first.
- CashScript enforcement on mainnet — not just theoretical verification.
- tokenId correlation across A/B tiers — edge cases expected.
See wiki/testing-strategy.md for the staged regtest → chipnet → mainnet plan.