Uh oh!
There was an error while loading. Please reload this page.
feat(dashmint-lab)!: gate minting on DashMint token burn (evo-sdk 3.1.0-dev.6) - #86
Conversation
Workaround: dev.6 requires consumers to call withVersion(11) explicitly. Thread a single named constant through the three EvoSDK.*Trusted factory calls so the override applies uniformly to testnet, mainnet, and local. Remove once a fixed SDK release lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a fixed-supply (100) DashMint token at position 0 of the card data contract and configure card.tokenCost.create to burn one token per mint. This replaces the owner-only creationRestrictionMode with token-cost gating, so anyone holding a DashMint token can mint a card and the token supply caps the lifetime number of cards a contract can ever produce. - contract.ts / dashMintToken.ts: declare token configuration, constants, and tokenPaymentInfo agreement; publish the token alongside the schema - mintCard.ts: pass tokenPaymentInfo on sdk.documents.create so the burn is authorized - SessionContext / MintForm / App: fetch and surface the signed-in identity's DashMint token balance, disable mint + starter-pack actions when the balance is insufficient, and refresh after each mint - dashmint-lite.html: point the read-only demo at the new token-enabled contract id - tests: add tokenPayment.test.ts plus MintForm/SessionContext coverage for the token balance and disabled states Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Align the app's SDK pin with the root tutorial bump in 512d80c so the token-payment APIs used by the DashMint mint-burn flow are available. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rename mint buttons to "Mint Card" / "Open Starter Pack", surface inline warnings when the DashMint token balance is below the cost, and point the default contract id at the current testnet deployment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update the mint-tab login-overlay assertions in browse.spec.ts and auth.spec.ts to match the new "Login to burn DashMint tokens" copy, and accept 43- or 44-char base58 in card.spec.ts since a 32-byte id can encode to either length depending on the leading byte. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tab switches were unmounting the grid and showing "Loading…" on every refetch, even though the previous tab's cards were already in memory. Cache results per sub-tab and only show the placeholder on first load; during background refresh, surface a small spinner next to the SubTabs and reserve the scrollbar gutter so the centered grid doesn't shift between tabs that overflow the viewport and tabs that don't.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a fixed‑supply DashMint token burn to card minting: SDK types and client token APIs, DashMint constants and balance helper, contract token configuration, mint flow wired to pass tokenPaymentInfo, session balance tracking, UI gating/display, tests, and documentation updates. ChangesDashMint Token Minting
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
example-apps/dashmint-lab/src/components/HowItWorks.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. example-apps/dashmint-lab/vite.config.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
thephez
commented
May 28, 2026
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@example-apps/dashmint-lab/public/dashmint-lite.html`:
- Around line 124-127: The HTML imports the wrong SDK version; update the script
tag that loads `@dashevo/evo-sdk` (currently pinned to 3.1.0-dev.1) to use
3.1.0-dev.6 so it matches the repo and dashmint-lab package.json; locate the
import near the CONTRACT_ID constant in dashmint-lite.html and replace the
version in the CDN/npm script URL to `@dashevo/evo-sdk`@3.1.0-dev.6.
In `@example-apps/dashmint-lab/src/components/HowItWorks.tsx`:
- Around line 28-31: Update the "Read token balance" row so its method string
documents both the token ID derivation and the balance call: replace the current
single method value ("sdk.tokens.identityBalances") with a combined description
showing the derivation and lookup (e.g., "sdk.tokens.calculateId(..., 0) →
sdk.tokens.identityBalances(...)") so it matches the real flow used by
sdk.tokens.calculateId and sdk.tokens.identityBalances.
In `@example-apps/dashmint-lab/src/components/MintForm.tsx`:
- Around line 39-40: The current early-return guards in MintForm (e.g., the
block checking submitting || mintingPack || hasInsufficientTokensForCard before
setSubmitting at the start of the mint flow and the similar guard around the
later write path) do not verify session.status; add an explicit guard that
session.status === "authenticated" (alongside existing checks for submitting,
mintingPack, hasInsufficientTokensForCard and existence of sdk/keyManager)
before performing any writes or calling withAuthedCard so mutations cannot run
in browse-only mode — update the start-of-flow guard and the later write/mint
handler (references: variables submitting, mintingPack,
hasInsufficientTokensForCard, session.status and usage of
withAuthedCard/sdk/keyManager) to return early unless session.status ===
"authenticated".
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 920f93e3-5c25-486c-a7c2-6d181585f13b
⛔ Files ignored due to path filters (2)
example-apps/dashmint-lab/package-lock.jsonis excluded by!**/package-lock.jsonpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (26)
example-apps/dashmint-lab/CLAUDE.mdexample-apps/dashmint-lab/README.mdexample-apps/dashmint-lab/package.jsonexample-apps/dashmint-lab/public/dashmint-lite.htmlexample-apps/dashmint-lab/src/App.tsxexample-apps/dashmint-lab/src/components/CollectionToolbar.tsxexample-apps/dashmint-lab/src/components/HowItWorks.tsxexample-apps/dashmint-lab/src/components/LoginModal.tsxexample-apps/dashmint-lab/src/components/MintForm.tsxexample-apps/dashmint-lab/src/dash/contract.tsexample-apps/dashmint-lab/src/dash/contractStorage.tsexample-apps/dashmint-lab/src/dash/dashMintToken.tsexample-apps/dashmint-lab/src/dash/mintCard.tsexample-apps/dashmint-lab/src/dash/types.tsexample-apps/dashmint-lab/src/session/SessionContext.tsxexample-apps/dashmint-lab/src/styles/globals.cssexample-apps/dashmint-lab/test/App.test.tsxexample-apps/dashmint-lab/test/MintForm.test.tsxexample-apps/dashmint-lab/test/SessionContext.test.tsxexample-apps/dashmint-lab/test/e2e/auth.spec.tsexample-apps/dashmint-lab/test/e2e/browse.spec.tsexample-apps/dashmint-lab/test/e2e/card.spec.tsexample-apps/dashmint-lab/test/tokenPayment.test.tspackage.jsonsetupDashClient-core.d.mtssetupDashClient-core.mjs
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Mirrors dashnote's v8 coverage setup: text + HTML reporter, scoped to src/ and excluding the Vite entrypoint plus ambient declaration files. Adds the missing test:coverage script, ignores the generated coverage/ output, and documents the new command in CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
@dashevo/evo-sdkto3.1.0-dev.6and pins platform protocol version to 11. Extends the contract registration to declare the DashMint token and attachtokenCost.createto thecarddocument type.sdk.tokens.calculateId/sdk.tokens.identityBalances, plusdocuments.create({ tokenPaymentInfo }). Type declarations insetupDashClient-core.d.mtsandsrc/dash/types.tsupdated to match.dashMintTokenBalancealongside credits; MintForm surfaces a token-balance warning and anOutOfTokensempty state. Collection sub-tabs cache cards to remove visible flicker on switch.tokenPayment.test.ts, MintForm balance/empty-state coverage, SessionContext token-balance assertions, and refreshed e2e overlay copy.Breaking changes
@dashevo/evo-sdk3.1.0-dev.1→3.1.0-dev.6. Requires pinning platform protocol version to 11 (PLATFORM_VERSION_OVERRIDE) as a temporary workaround.creationRestrictionModeflipped from owner-only to open, and a newtokenCost.createrule burns 1 DashMint token per mint. Callers ofmintCardmust now passtokenPaymentInfo. The contract declares a fixed-supply token at position 0.localStoragewill fail to mint until they clear it or pick a new contract.DashSdk/ConnectedDashClientLiketypings widened:sdk.documents.createaccepts optionaltokenPaymentInfo; a new requiredsdk.tokensmember (calculateId,identityBalances) is declared. Existing mocks/stubs implementing this interface need to addtokens.Test plan
npm run lint(root +example-apps/dashmint-lab)npm run buildinexample-apps/dashmint-labnpm testinexample-apps/dashmint-lab(Vitest)npm run test:e2eagainst testnet with a fundedPLATFORM_MNEMONICSummary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
Chores