Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/DOCUMENTATION_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ This file lists the documentation that is most likely to need updates when behav
- `docs/decisions/0003-adopt-besu-qbft-osaka-with-archive-rpc.md`: Why the sandbox replaces Clique/London with Besu QBFT/Osaka, separates the validator from a Forest archive/RPC node, rejects a beacon client, and requires a destructive chain reset.
- `docs/decisions/0004-settle-all-bond-cash-legs-in-wnok.md`: Why every bond cash leg (issuance, buyback, coupon, redemption) settles in `Wnok` from a government reserve account, removing the government-nominated `Tbd` from the bond stack while keeping the allowance-based authorization for the closed-loop plan to replace. Accepted.
- `docs/plans/README.md`: How implementation plans are laid out — new plans are folders with `intent.md`, `design.md`, `plan.md`, and a committed `progress.md`; existing single-file plans stay as they are.
- `docs/plans/bond-cash-leg-wnok/`: Plan folder (intent, design, plan, progress) to pay bond coupon, buyback, and redemption in wNOK from the government reserve account instead of the government-nominated TBD, so primary dealers buy and are paid in central-bank money; covers `BondManager`, deploy wiring, tests, the Central Bank API field and UI, and the two related known issues.
- `docs/plans/closed-loop-settlement-and-omnibus-custody-plan.md`: Plan to settle the primary auction cash leg by central-bank authority instead of a bidder ERC-20 allowance (fixes the `ERC20InsufficientAllowance` / `FailureReason.Cash` finalisation failure), then a phased path to omnibus broker custody, a unified `PrimaryDealerRegistry`, and two-tier coupon/redemption. Phase 1 is diff-level (Roles + Wnok `settle()` + BondDvP cash-leg swap + deploy wiring); Phases 2–6 are roadmap.
- `docs/plans/sandbox-fmi-wallet-plan.md`: Sandbox-only implementation plan for a multi-participant institutional wallet with encrypted local keys, typed transaction intents, simulated maker/checker approval, directory-backed recipient selection/revalidation, durable audit, and removal of bidder impersonation from the NB Bond API.
- `docs/plans/sandbox-entity-directory-and-name-service-plan.md`: Standalone sandbox entity-directory/name-service plan with its own persistent database, backend API, search/admin UI, synthetic profile/contact enrichment, optional provenance-aware on-chain registry readers, and a BENS-compatible Blockscout adapter backed by the same directory data.
- `docs/plans/erc-3643-incremental-adoption-plan.md`: **Superseded in direction by `docs/decisions/0002-adopt-erc-3643-for-tokenized-securities.md`** (full migration to canonical ERC-3643 for bonds + equities, retiring the partitioned `BondToken` and the ERC-20 `StockToken`). Retained as the record of the *incremental* approach considered and rejected — a shared external identity registry + modular compliance bolted onto the existing partitioned `BondToken` and cash (`Wnok`), closing the bond transfer-eligibility gap first, then agent powers, compliance modules, and full ONCHAINID. Its eligibility-gap analysis and phase mechanics remain a useful reference.
- `docs/plans/archive/`: Reference-only archive of completed implementation plans. Status lines inside each plan record the implementing PR and its state where relevant:
- `docs/plans/archive/bond-cash-leg-wnok/`: Plan folder (intent, design, plan, progress) that moved bond coupon, buyback, and redemption cash from the government-nominated TBD to wNOK paid from the government reserve account, so primary dealers buy and are paid in central-bank money; covers `BondManager`, deploy wiring, tests, the Central Bank API field and UI, live-change publication, and the two related known issues, with the fresh-sandbox balance trail in `progress.md`. Decision in ADR 0004. Shipped via #272 and #273.
- `docs/plans/archive/browserslist-dev-transitive-refresh-plan.md`: Lockfile-only refresh of the development-scoped transitive `browserslist` (4.28.2 → 4.28.8, Dependabot alert #76) together with the five sibling packages it requires; no manifest or override change, gated by the structural lockfile diff and override audit. Shipped via #263.
- `docs/plans/archive/besu-qbft-osaka-upgrade-plan.md`: Completed greenfield upgrade from Besu 26.1.0 Clique/London to Besu 26.7.0 QBFT/Osaka, with separate validator and Forest archive/RPC nodes, Solidity 0.8.36, OpenZeppelin 5.6.1, static-peer wiring, chain-identity reset safeguards, and clean-cluster acceptance evidence.
- `docs/plans/archive/backend-design-improvements-backlog.md`: Historical NB Bond API architecture backlog. Its main projection, read-your-writes, audit-trail, and lifecycle-status work shipped; residual ideas are retained for context but are no longer maintained as an active plan.
Expand Down
3 changes: 2 additions & 1 deletion docs/diagrams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ ADR 0002 but is not drawn as deployed software.
- [Bid cryptography](processes/bid-cryptography-flow.md): bidder intent,
encryption, plaintext commitment, and finalisation proof verification.
- [Coupon and redemption](processes/coupon-redemption-sequence.md):
government TBD cash payments and bond maturity/redemption.
WNOK payments from the government reserve account and bond
maturity/redemption.
- [TBD cross-bank transfer](processes/tbd-cross-bank-transfer.md): deposit-token
burn, WNOK reserve movement, callback, and destination mint.
- [Sandbox bank creation](processes/bank-creation-sequence.md): bank-key-signed
Expand Down
3 changes: 1 addition & 2 deletions docs/diagrams/architecture/contract-topology.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ flowchart TB
manager -->|"partition, mint, coupon, redeem"| bond
manager -->|"settle each allocation or payout"| bondDvp
bondDvp -->|"partition transfer or redemption"| bond
bondDvp -->|"RATE / PRICE issuance cash"| wnok
bondDvp -->|"BUYBACK, coupon, redemption via Nordea TBD"| tbdN
bondDvp -->|"issuance, buyback, coupon, redemption cash<br/>against the government reserve account"| wnok

stockFactory -->|"deterministic minimal clones"| stock
broker -->|"buy / sell / revoke"| orderbook
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bond cash leg in wNOK — Implementation Plan

**Status:** In progress
**Status:** Implemented — shipped via #272 (contracts, deploy wiring, ADR 0004) and #273 (API, UI, docs); archived 2026-09-08
**Created:** 2026-09-07
**Scope:** `contracts/src/norges-bank/BondManager.sol`, `contracts/script/norges-bank/10_Bond.s.sol`, `contracts/script/norges-bank/11_BondSetup.s.sol`, `contracts/test/norges-bank/BondManager.t.sol`, `contracts/test/integration/BondLifecycle.t.sol`, `services/nb-bond-api` (ABI, Central Bank resource, revert decoding), `services/nb-ui` (Central Bank page, pay-coupon modal), contract and architecture docs, `docs/KNOWN_ISSUES.md`, ADR 0004
**Intent:** [`intent.md`](intent.md) · **Design:** [`design.md`](design.md) · **Progress:** [`progress.md`](progress.md)
Expand Down Expand Up @@ -339,8 +339,8 @@ python3 scripts/verification/check-markdown-links.py

## Done Criteria

- [ ] Every acceptance criterion in `intent.md` has evidence in `progress.md`.
- [ ] No temporary compatibility path remains.
- [ ] `forge test`, both package gates, and the public-repo checks pass.
- [ ] Documentation matches the implemented behaviour.
- [ ] PR evidence contains no private environment information.
- [x] Every acceptance criterion in `intent.md` has evidence in `progress.md`.
- [x] No temporary compatibility path remains.
- [x] `forge test`, both package gates, and the public-repo checks pass.
- [x] Documentation matches the implemented behaviour.
- [x] PR evidence contains no private environment information.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

**Plan:** [`plan.md`](plan.md)
**Last updated:** 2026-09-08 — Phases 2 to 5 done on `feature/bond-cash-leg-wnok-api`; fresh-sandbox lifecycle run recorded
**Current phase:** All phases done; waiting on PR #272 to merge before PR 2
**Next action:** After PR #272 merges, rebase `feature/bond-cash-leg-wnok-api` onto `development`, rerun both package gates, open PR 2; archive this folder with `Status: Implemented` once PR 2 merges
**Current phase:** Complete — #272 and #273 merged; folder archived 2026-09-08
**Next action:** None; follow-ups are listed below and, where accepted, in `docs/KNOWN_ISSUES.md`

## Phase Log

Expand Down Expand Up @@ -72,7 +72,7 @@ step and the Banking page's TBD listing was unaffected.

## Blocked / Waiting On

- PR #272 merge (operator), then rebase and open PR 2.
- Nothing.

## Follow-ups Found Along the Way

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ PrimaryDealerRegistry (Phase 2), any custody/broker change (Phase 3+), coupon/re

**Phase 5 — Secondary venue refactor.** Replace the holder-level `BondOrderBook` (which presumes segregated on-chain balances, incompatible with omnibus) with a **broker-level venue**: same-broker fills = off-chain book entries; cross-broker fills = on-chain DvP with **EIP-712 signed orders + open-loop cash authorization** (the legitimately-open-loop leg that *does* use signatures/allowances).

**Phase 6 — Coupon & redemption.** _Note (2026-09-08): coupon, buyback, and redemption already settle in wNOK from the government reserve account (ADR 0004, `docs/plans/bond-cash-leg-wnok/`), so this phase starts from a single token; the TBD leg described below is superseded._ Coupon: CB debits the gov reserve (authority) → the gov's designated bank mints **backed** TBD (`Tbd._mintFromGovReserve` already backs it) → distributes **per broker** (fan-out scales) → brokers credit clients off-chain. Redemption at maturity: reverse DvP via `redeemFor`/`buybackRedeemFor` (burn bond ↔ return principal in wNOK by authority).
**Phase 6 — Coupon & redemption.** _Note (2026-09-08): coupon, buyback, and redemption already settle in wNOK from the government reserve account (ADR 0004, `docs/plans/archive/bond-cash-leg-wnok/`), so this phase starts from a single token; the TBD leg described below is superseded._ Coupon: CB debits the gov reserve (authority) → the gov's designated bank mints **backed** TBD (`Tbd._mintFromGovReserve` already backs it) → distributes **per broker** (fan-out scales) → brokers credit clients off-chain. Redemption at maturity: reverse DvP via `redeemFor`/`buybackRedeemFor` (burn bond ↔ return principal in wNOK by authority).

---

Expand Down