Skip to content

feat: add a token vesting example over canton-token-forge - #246

Merged
gabitoesmiapodo merged 82 commits into
mainfrom
feat/token-vesting-example
Oct 27, 2026
Merged

gabitoesmiapodo merged 82 commits into
mainfrom
feat/token-vesting-example

Conversation

@gabitoesmiapodo

@gabitoesmiapodo gabitoesmiapodo commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

No related issue. Replaces #199: its token-forge dApp no longer replaces the Canton Coin one, and becomes a second example users can pick in the installer.

Changes

  • Adds token-vesting, a vesting dApp over a canton-token-forge DBT token
  • The installer offers it in the dApp list and as --example token-vesting
  • Its bootstrap uploads the two vendored DARs and writes the registry settings to .env.registry
  • dev-stack.sh runs an app's optional stack:up and stack:down scripts, which start and stop the token registry
  • pnpm dev:token-vesting runs the example's stack from the repo root
  • Carries feat: vest a canton-token-forge instrument instead of canton coin #199's dApp work: the DBT faucet, one-approval grants, cancel and decline before acceptance

Deviations

Acceptance criteria

  • An installer project with --example token-vesting --localnet installs and runs pnpm stack up
  • A DBT grant is created, accepted, claimed and cancelled end to end
  • amulet-vesting behaves as on main
  • The token example needs no dpm

Test plan

Automated tests

  1. Run pnpm install
  2. Run pnpm lint, pnpm typecheck, pnpm test, pnpm knip and pnpm docs:check
  3. Expect every check to pass, with 319 tests in example-dapps/token-vesting

Manual verification

  1. Run pnpm -C canton-create try
  2. In canton-create/.try, run npm create canton-dappbooster my-app -- --example token-vesting --localnet
  3. In my-app, run pnpm install and pnpm stack up
  4. Open http://localhost:3012 and connect through Wallet Gateway with client secret unsafe
  5. Tap DBT from the account menu, create a grant to a second party, and accept it as that party
  6. Expect the receiver to claim vested DBT and the funder's balance to drop by the grant

Breaking changes

None.

Checklist

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

Screenshots

token-vesting-1-fund-a-grant.mp4
token-vesting-2-accept-and-claim.mp4
token-vesting-3-cancel.mp4

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
lmcorbalan and others added 14 commits October 7, 2026 19:59
…migration

main moved dapp/frontend to example-dapps/amulet-vesting and the stack
scripts into canton-create/scaffold. The token-forge dApp now gets its own
folder instead of replacing the Canton Coin one:

- example-dapps/token-vesting holds this branch's dApp, as
  @bootnodedev/canton-example-token-vesting
- example-dapps/amulet-vesting stays as it is on main
- vendor/ moves into the new example, and bootstrap-vesting.mjs uploads
  both DARs itself, since the app has no daml/daml.yaml
- the registry start and stop move out of dev-stack.sh into the example's
  scripts/registry.sh, run through new optional stack:up and stack:down
  scripts
- dev-stack.sh saves bootstrap's output to .dev-stack/bootstrap.log
- biome.json lets an example's scripts/ use relative imports, as the
  repo rules already say
- kit/, the mint-token guard and the build-dar removal give way to main
- add token-vesting to EXAMPLES in src/apps.ts, so the dApp list and
  --example token-vesting offer it
- list it in the README beside amulet-vesting
- record demo.svg again, since the dApp list gained a line
- add dev:token-vesting, which runs dev-stack.sh on
  example-dapps/token-vesting
- mint-token, build-dar and deploy-dar keep a CANTON_APP_DIR the caller
  already set, so the token stack mints into its own .env instead of
  amulet-vesting's
- rewrite example-dapps/token-vesting/README.md for DBT, the vendored
  DARs and the token registry; it still described Amulet
- point the example's CLAUDE.md, PROVENANCE.md and architecture.md at
  its own folder
- list the example, its registry port 3013 and dev:token-vesting in the
  root CLAUDE.md, architecture.md and CONTRIBUTING.md
- describe the stack:up and stack:down scripts dev-stack.sh runs, in
  canton-create's docs and the localnet README section
In the monorepo both examples share .dev-stack/, so running one stack
overwrote the bootstrap.log the other's stack:up and stack:down read.

- bootstrap.log and DEV_STACK_RUN_DIR now sit in a folder per app,
  .dev-stack/example-dapps/<name>/ in the monorepo
- a generated project keeps plain .dev-stack/
registry.sh started the registry through `pnpm exec`, so the pid on file
was pnpm's and `stop` relied on the port scan to reach the registry. It
now runs the bin from node_modules/.bin, whose shim execs node, so the
pid on file is the registry.
- .lintstagedrc.mjs runs an example's tests when its api/ or scripts/
  change, not only src/, which the token example's suites cover
- knip.json goes back to one-line arrays, with the token-vesting block
  added in the same style
bootstrap printed the registry's settings, dev-stack.sh saved its output
to a log, and registry.sh read the keys back out of it. Now:

- bootstrap-vesting.mjs writes the settings to the gitignored
  .env.registry, which the registry loads through DOTENV_CONFIG_PATH
- dev-stack.sh drops the bootstrap log and the per-app run folder, and
  keeps only the stack:up and stack:down calls
- registry.sh loses its key list and log parsing, stops the registry by
  its port, waits with one loop, and defaults DEV_STACK_RUN_DIR, so
  `pnpm stack:up` also works without the local network
- the bootstrap test checks the file parses as dotenv reads it, and runs
  in the node environment instead of jsdom
The token example has no daml/, so dev-stack.sh never runs build-dar or
deploy-dar for it. Only mint-token needs to keep a CANTON_APP_DIR the
caller set, so the other two go back to always naming amulet-vesting.
A change under an example's api/ or scripts/ ran its whole vitest suite.
It now runs `vitest run api scripts` there, and src/ keeps the full run.
- biome.json turns noRestrictedImports off in one last override for
  **/scripts/**, as the repo rules say, instead of excluding scripts/
  from the example-dapps override alone
- the allowBuilds comments in both pnpm-workspace files fit one line
@gabitoesmiapodo gabitoesmiapodo self-assigned this Oct 23, 2026
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
components.canton-dappbooster Ready Ready Preview Oct 27, 2026 5:32pm UTC
demo.canton-dappbooster Ready Ready Preview Oct 27, 2026 5:32pm UTC

Request Review

@lmcorbalan lmcorbalan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gabitoesmiapodo
gabitoesmiapodo merged commit f37e629 into main Oct 27, 2026
9 checks passed
@gabitoesmiapodo
gabitoesmiapodo deleted the feat/token-vesting-example branch October 27, 2026 20:52
@github-project-automation github-project-automation Bot moved this from In review to Done in Canton - dAppBooster (#390) Oct 27, 2026

This branch was successfully deployed

2 active deployments
Preview – components.canton-dappbooster — 4c566d0d Deployed Oct 27, 2026 by vercel[bot]
Preview – demo.canton-dappbooster — 4c566d0d Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants