Repository navigation
M3 Workstreams A–D — scaffold, token setup, earn/mint, redeem/burn + balance - #1
Merged
Merged
Conversation
…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>
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>
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
Treasuryfind-or-creates the businesskudos-treasurywallet (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-sdpbumped to the local 0.3 path dep (the engine PR adds the Token model + MintJob). Engine token tables migrated in.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