Skip to content

Tbd: bind cctFrom to the payer and remove the unused nomination path - #300

Merged
Greaker merged 2 commits into
developmentfrom
feature/tbd-payer-bound-cct
Sep 28, 2026
Merged

Greaker merged 2 commits into
developmentfrom
feature/tbd-payer-bound-cct

Conversation

@Greaker

@Greaker Greaker commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tbd.cctFrom now moves only the caller's own deposit, unless the caller is the DvP contract passed to the constructor; any other caller reverts with CctFromNotCaller. CCT_FROM_CALLER_ROLE is still required.
  • The government-nomination path has had no consumer since bond cash legs moved to wNOK (ADR 0004), so it is removed from Tbd/ITbd/Errors, the TBD and wNOK setup scripts, the NB Bond API TBD DTO (government field; OpenAPI regenerated) and the Banking page KPI.
  • The NB Bond API deploys created banks from refreshed Tbd ABI and bytecode artifacts (six-argument constructor). Contract reference, NatSpec pages and TBD diagrams describe the caller rule.
  • Changes deployed bytecode: takes effect on the next contract deploy.

First of four stacked contract PRs.

Test plan

  • cd contracts && forge fmt --check && forge build --sizes && bash ./check-verify-latest-mapping.sh && forge test -vvv (393 passed)
  • cd services/nb-bond-api && npm run lint && npm run format:check && npm test && npm run build (jest 254)
  • cd services/nb-ui && npm run format:check && npm run lint && npm test && npm run build (vitest 125)
  • python3 scripts/verification/check-public-repo-hygiene.py && python3 scripts/verification/check-markdown-links.py
  • Contracts CI (Slither) green

cctFrom now moves only the caller's own deposit, unless the caller is the
DvP contract passed to the Tbd constructor, which keeps settling on behalf
of the payer. CCT_FROM_CALLER_ROLE is still required. Any other caller
reverts with the new CctFromNotCaller error, so the payer rule lives in
the contract rather than in how the role is assigned.

The government-nomination path has had no consumer since bond cash legs
moved to wNOK, so it is removed: the constructor loses its reserve
argument, and govReserve, isGovernmentNominated, the reserve mint branch
in _update and NotGovernmentNominated are gone. The TBD and wNOK setup
scripts no longer allowlist the reserve on TBD Nordea or give it a wNOK
allowance there. The DvP settlement fixture now constructs its TBDs with
the DvP that settles, instead of deploying a second one afterwards.

The NB Bond API deploys created banks with the six-argument constructor
from refreshed Tbd ABI and bytecode artifacts, drops the government field
from the TBD DTO (OpenAPI regenerated), and the Banking page drops the
matching KPI. Contract reference, NatSpec pages and the TBD diagrams
describe the caller rule.

Tests: forge 393 passed (new: payer-only cctFrom and DvP settlement on
behalf of the payer); nb-bond-api jest 254 passed; nb-ui vitest 125
passed.
operatorTransferByPartition no longer reads a destination partition from
the first 32 bytes of data. Like transferByPartition, it now always moves
units within the partition it is given and treats data and operatorData
as opaque event payload. The internal _transferByPartition and _move
helpers take a single partition, so a partition's supply changes only
through mint and redemption, and ChangedPartition stays in IERC1410 as
part of the standard surface but is never emitted. The bond stack never
used partition changes: BondDvP always passes empty data. The
transferByPartition NatSpec, which described a data-driven partition
switch it never performed, is corrected.

The BondToken invariant suite now runs two ISINs and a holder transfer
action that names either partition in data, and checks supply against
offering and holder balances per partition.

Tests: forge 395 passed (new: an operator transfer stays in its source
partition and emits no ChangedPartition; a unit moved with another
partition in data does not reduce that partition's issuance headroom;
extended invariants). The BondToken ABI is unchanged.
@Greaker
Greaker merged commit 47a87ac into development Sep 28, 2026
10 checks passed
@Greaker
Greaker deleted the feature/tbd-payer-bound-cct branch September 28, 2026 12:43
Greaker added a commit that referenced this pull request Oct 2, 2026
Six plan folders under docs/plans/, each with intent, design, plan, and
progress files, grounded in a review of the current development branch:

- bond-coupon-maturity-correctness: per-holding coupon rounding, RATE
  auction gating after a cancel, matured partitions closed to new
  issuance, the BUYBACK cancel revert, and bond transfer eligibility.
- ingestion-projection-correctness: abortable ingestion loop that closes
  its connection, chain-ordered log application, idempotent bond state,
  newest-first history, and finalisation that tolerates invalid bids.
- nb-bond-api-hardening: per-signer nonces, one RFC 7807 error handler,
  liveness probe and chart defaults, scoped runtime image, cleanup.
- nb-ui-correctness-and-hardening: router and error boundaries, one 401
  path, matured KPI, live coupon preview, bidder soft delete, history
  card, nginx headers, dead-code removal.
- sandbox-scripts-and-ci-hardening: flag precedence, failing readiness
  timeouts, command validation, bid-tool install, loopback ports, image
  pins, pin-drift check, CI gaps.
- documentation-refresh: neutral deployment wording, plan-tree
  housekeeping, removed behaviour still documented, known issues,
  NatSpec source links, licence inventory.

All plans are Proposed; the documentation index lists them. Four progress
files note what changed on development after planning (#300 to #305)
and which plan steps that makes moot.
@Greaker Greaker mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant