Skip to content

M3 Workstreams A–D — scaffold, token setup, earn/mint, redeem/burn + balance - #1

Merged
moviendome merged 4 commits into
mainfrom
feat/m3-a-custodial-scaffold
Jun 30, 2026
Merged

moviendome merged 4 commits into
mainfrom
feat/m3-a-custodial-scaffold

Conversation

@moviendome

@moviendome moviendome commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

The Kudos M3 reference-app foundation — Workstreams A + B + C. Kudos is the issuance counterpart to Lamport: email signup → per-user custody wallet via SDP, a business issues a points token, users earn (mint) points. Pairs with engine PR solrengine/sdp#2 (the issuance Token model + MintJob, 0.3).

A — custodial scaffold

Email/password auth (replacing the template's SIWS); User ← WalletOwner + after_create_commit :provision_wallet!; dashboard provisioning states (Stimulus poller); Kudos landing. Gems: solana-sdp/solrengine-sdp/solrengine-realtime (~> 0.2) + bcrypt.

B — points-token setup (business side)

Treasury find-or-creates the business kudos-treasury wallet (mint authority); token create → deploy flow + status views. (B used an app-side PointsToken, replaced in C by the engine model.)

C — earn/mint on the engine Token

  • solrengine-sdp bumped to the local 0.3 path dep (the engine PR adds the Token model + MintJob). Engine token tables migrated in.
  • PointsToken → Solrengine::Sdp::Token (register!/deploy!/mint!) — the "extract against the consumer" payoff.
  • EarningsController#create → token.mint!(destination: user wallet, amount: 10); dashboard "Earn 10 points" button + recent-mints list.

Verification

bin/rails test — 19 runs, 73 assertions, 0 failures (auth, provisioning, token lifecycle, earn flow; WebMock-stubbed). rubocop clean.

Next

D — redeem/burn + live points balance (doorbell) + rewards catalog · E tutorial · F publish engine 0.3 + deploy + showcase + M3 close.

Draft. No CI in the dApp template; verified locally. Engine 0.3 publishes at F (then the Gemfile path reverts to ~> 0.3).

🤖 Generated with Claude Code

moviendome and others added 2 commits June 25, 2026 15:52
…oning

Adapts the SIWS template to Kudos's custodial model (the loyalty-points
reference app):

- Gemfile: drop solrengine-auth/programs; add solana-sdp, solrengine-sdp,
  solrengine-realtime (~> 0.2), solrengine-rpc, bcrypt, webmock
- Auth: SIWS → Rails 8 email/password (has_secure_password, session[:user_id]);
  SessionsController + RegistrationsController + login/signup views
- User includes Solrengine::Sdp::WalletOwner + after_create_commit
  :provision_wallet! (async ProvisionWalletJob)
- Migration: email/password + SDP wallet columns; config/initializers/solrengine_sdp.rb
  (label_namespace=kudos); broadcast targets deferred to Workstream D
- Dashboard: pending→provisioning→ready states with a Stimulus refresh poller;
  Kudos landing page
- Tests green (12 runs), rubocop clean, boots + renders. CLAUDE.md updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- PointsToken (singleton) model + migration: name/symbol/decimals(0)/
  sdp_token_id/mint_address/signing_wallet_id/status; PointsToken.current
- Treasury: find-or-create the business 'kudos-treasury' custody wallet
  (mint authority / signing wallet), idempotent by label
- TokensController: new/create (treasury -> create_token -> persist) +
  deploy (deploy_token -> mint_address); singleton :token route
- Views: setup form + token status (deploy button / mint address); dashboard
  operator entry point
- Tests (stubbed SDP): create registers token + provisions treasury, adopts
  existing treasury by label, deploy records mint, single-use guard, error path

20 runs, 65 assertions, 0 failures. rubocop clean. Points are whole (0 decimals).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@moviendome moviendome changed the title M3 Workstream A — custodial scaffold (email auth + Wallet-per-User) M3 Workstreams A+B — custodial scaffold + points-token setup Jun 25, 2026
Replaces B's app-side PointsToken with the extracted engine model
Solrengine::Sdp::Token (the 'build against the consumer, then extract' payoff).

- Gemfile: solrengine-sdp -> local path (engine 0.3, unpublished; revert to
  ~> 0.3 at F). Engine token tables migrated into Kudos.
- TokensController uses Solrengine::Sdp::Token.register!/deploy!
- EarningsController#create -> token.mint!(destination: user wallet, amount: 10)
- Dashboard: 'Earn 10 points' button + recent-mints list with status
- 19 runs, 73 assertions, 0 failures; rubocop clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@moviendome moviendome changed the title M3 Workstreams A+B — custodial scaffold + points-token setup M3 Workstreams A+B+C — scaffold + token setup + earn/mint Jun 25, 2026
- Reward model + migration + seeds (catalog); PointsBalance reads the user's
  on-chain points balance from SDP (nil = unknown, never zero)
- RedemptionsController#create → token.burn!(source: user wallet,
  signing_wallet_id: user wallet) after an affordability check (custodial burn)
- Dashboard: real balance, rewards list with redeem buttons (disabled when
  unaffordable), recent activity
- Live doorbell: broadcast_targets re-fetch the balance → Turbo Stream replace
  #points_balance; bin/sdp_watcher + turbo_stream_from + balance partial
  (stack-verified; balance read + redeem are stub-tested)
- 25 runs, 96 assertions, 0 failures; rubocop clean

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@moviendome moviendome changed the title M3 Workstreams A+B+C — scaffold + token setup + earn/mint M3 Workstreams A–D — scaffold, token setup, earn/mint, redeem/burn + balance Jun 25, 2026
@moviendome
moviendome merged commit a56d05d into main Jun 30, 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