Skip to content

feat: vest a canton-token-forge instrument instead of canton coin - #199

Open
lmcorbalan wants to merge 66 commits into
mainfrom
feat/157-token-forge-migration
Open

feat: vest a canton-token-forge instrument instead of canton coin#199
lmcorbalan wants to merge 66 commits into
mainfrom
feat/157-token-forge-migration

Conversation

@lmcorbalan

@lmcorbalan lmcorbalan commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #157

Canton Coin tied every write to Splice reference data: AmuletRules, an open mining round and a
wallet-service tap. The dApp now vests a DBT token-forge instrument through one InstrumentConfig
from a CIP-56 registry, which drops the Daml toolchain from the repository and grant creation to a
single wallet approval.

Changes

  • Vests a DBT token-forge instrument; Canton Coin vesting is removed, not kept alongside
  • Both DARs ship as vendored binaries and the Daml package is gone, so dpm is no longer required
  • dev-stack.sh runs the canton-token-forge registry on 3013 and bootstrap seeds the instrument
  • The value-moving choices take one InstrumentConfig disclosure, so a grant costs one approval
  • A grant reserves only the amount it vests and the rest comes back as change
  • The funder can cancel and the receiver can decline a grant that was never accepted
  • An in-app faucet taps DBT from the dashboard header
  • The deployed origin forwards the registry routes same-origin, replacing the wallet RPC proxy

Deviations

Acceptance criteria

  • A grant is created, accepted, withdrawn, cancelled and residual-claimed in DBT end to end
  • dpm is not required to run the repository
  • No AmuletRules or mining round reaches a write
  • Creating a grant is one wallet approval, not two

Test plan

Automated tests

  1. Run pnpm install
  2. Run pnpm lint, pnpm typecheck, pnpm build, pnpm test, pnpm knip, pnpm docs:check and pnpm run check:anatomy from the repo root
  3. Expect every gate to pass, with dapp/frontend at 223 tests

Manual verification

  1. Check out this branch, run ./scripts/dev-stack.sh up and wait for 3010, 3012 and 3013 to answer
  2. Open http://localhost:3012 and connect a CIP-0103 wallet as the funder
  3. Tap the faucet in the dashboard header and expect the DBT balance to rise by 1000
  4. Create a grant and expect exactly one wallet approval
  5. Open /pending as the funder, cancel a grant, and expect its reserved holdings back in the balance
  6. Create another grant, accept it as the receiver, then withdraw, cancel and claim the residual
  7. Expect both balances to settle and no Splice call anywhere in the flow

Breaking changes

  • pnpm run build-dar is gone; both DARs ship under vendor/ and pnpm run deploy-dar -- <dar> uploads them
  • VITE_WALLET_RPC_URL is replaced by VITE_REGISTRY_URL, and a deployment also needs REGISTRY_URL pointing at a reachable registry

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

Screenshots

To be added before review.

lmcorbalan and others added 30 commits September 4, 2026 12:57
build: vendor the canton-token-forge and vesting DARs
build: add the canton-token-forge registry service as a dev dependency
feat(scripts): seed the DBT instrument admin and config in bootstrap
feat(scripts): deploy the vendored DARs and run the token registry on 3013
feat: add the token-forge side alongside the Canton Coin one
feat(frontend): learn the instrument from the registry and move to the vesting factory
feat(frontend): move the vesting choices onto the instrument config
feat(frontend): select token holdings instead of splitting, and add the faucet tap
feat: forward the registry routes from the deployed origin
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
demo.canton-dappbooster Error Error Sep 11, 2026 8:21pm UTC
docs.canton-dappbooster Ready Ready Preview Sep 11, 2026 8:21pm UTC

Request Review

Main had moved the root tooling into kit/, added the npm publish flow and the
version lockstep check. This branch had removed the Daml package. Eight files
conflicted.

- package.json: main's script block, minus build-dar
- knip.json: both ignore lists, minus the dapp/daml workspace entry
- dapp/daml/package.json: kept this branch's deletion
- CLAUDE.md, architecture.md, README.md, dapp/frontend/README.md: main's kit/
  and publishing prose, this branch's DBT and vendored DAR prose
- pnpm-lock.yaml: regenerated rather than hand-merged

Main also deleted @mermaid-js/mermaid-cli, which this branch still named in
knip.json, pnpm-workspace.yaml and CLAUDE.md.

Two things the merge left pointing at files that no longer exist:

- scripts/lib/gate.mjs moved to kit/gate.mjs. Every importer is in kit/ now,
  so it has to leave with that folder.
- kit/manifests.mjs and kit/release-version.test.mjs named dapp/daml.

The consumer scaffold section of CLAUDE.md described a six-entry deletion list
and promised no file rewriting. The installer deletes seventeen paths and also
strips seven scripts and two devDependencies from package.json, so the section
now points at source/stacks/canton.ts as the list. postcss leaves knip's
ignoreDependencies for the same reason: the installer removes the dependency.
Dropping it was wrong. The installer removes the dependency today, so the
entry is redundant, but knip reports an unused devDependency as an error and
not a hint. Keeping the entry costs one configuration hint and saves a
consumer tree from failing the day the installer stops removing postcss.

The reason is now written out where the scaffold rules are, instead of
pointing at a paragraph that no longer explained it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Vest a canton-token-forge instrument instead of Canton Coin

2 participants