Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 3.54 KB

File metadata and controls

73 lines (54 loc) · 3.54 KB

Implementation Plan

How stellar-mint gets built: in spectrum order, in runnable pieces, shipped as cumulative class branches. Every class ends with a green npm run reproduce:class-N on testnet.


Phase map

Phase Builds Branch Tag Status
0 Scaffolding (service layer, asset.config.ts, bootstrap)
1 Class 1 — trustline + issue ops, issue.ts, reproduce:class-1 class-1-emissao-trustlines v0.1-consentimento
2 Class 2 — flags + clawback ops, config flags, reproduce:class-2 class-2-controle-stablecoin v0.2-controle
3 Class 3 — amm + swap ops, reproduce:class-3 class-3-liquidez-amm v0.3-mercado
4 Frontend (holder-facing dApp) main

Status legend: ⬜ todo · 🔵 in progress · ✅ done. The Status column is the single source of truth — update it in the same commit that lands the phase.


Hard rules

  1. Flags before distribution (D11). scripts/issue.ts always sets issuer control flags before any payment. This is what makes clawback work and is the Class-2 lesson made operational.
  2. Testnet only (D2). The assertTestnet guard stays; no mainnet code path is ever added.
  3. The reproduce check is the demo (D9/D13). A class is not done until its reproduce:class-N runs end-to-end on a clean checkout, asserting both the successes and the expected failures.
  4. Irreversible ops are opt-in and loud. lockIssuer only runs when the config asks; it is documented as one-way everywhere it appears.

Per-phase detail

Phase 0 — Scaffolding ✅

Service layer (src/lib/*), declarative asset.config.ts, scripts/bootstrap.ts, the npm-script gate (typecheck + lint), and CI. npm run bootstrap verified against testnet (three funded accounts + artifacts written).

Phase 1 — Class 1: Emissão & Trustlines ✅

src/operations/{trustline,issue}.ts, scripts/issue.ts, scripts/reproduce/class-1.ts. Reproduce: distribute cBRL through a trustline; force and assert op_no_trust on the no-trustline path. Ships as class-1-emissao-trustlines / v0.1-consentimento.

Phase 2 — Class 2: Controle & Stablecoins ✅

src/operations/{flags,clawback}.ts, the flags/lockIssuer config path in issue.ts, scripts/reproduce/class-2.ts. Reproduce: authorize → freeze → clawback → lock, asserting each. Ships as class-2-controle-stablecoin / v0.2-controle.

Phase 3 — Class 3: Liquidez & AMM ✅

src/operations/{amm,swap}.ts, scripts/reproduce/class-3.ts. Reproduce: seed a cBRL/USDx pool, strict-send swap (assert the price moved), withdraw. Ships as class-3-liquidez-amm / v0.3-mercado.

Phase 4 — Frontend ✅

Vite/React/TS/Tailwind, reusing the album's wallet.ts / friendbot.ts / store.tsx patterns; pages for trustline (C1) and pool/swap (C3). Lands on main. Builds green (tsc --noEmit && vite build) and boots; full wallet flow is a manual browser step.


Definition of Done (per class)

A class is done only when (decisions.md D13):

  1. npm run typecheck and npm run lint are green.
  2. npm run reproduce:class-N runs end-to-end on a clean checkout via one documented command.
  3. The relevant /docs and decisions.md are updated (including this Status column).