Repository navigation
fix(tokens): keep the Token Creator form and build exactly the preset it shows - #1130
Conversation
Pin dash-sdk, rs-sdk-trusted-context-provider, platform-wallet and platform-wallet-storage to dashpay/platform v5.1-dev 063589bf (5.0.0-rc.8). The lockfile moves only the Platform packages. The upstream V019 wallet-storage migration adds a nullable asset-lock operation id; V001-V018 are unchanged. The compatibility bridge gets the 033ecae destination snapshot it compares against, and the pin guard records the new revision with an unchanged migration fingerprint. BREAKING CHANGE: the wallet storage upgrade to V019 is forward only. An older build cannot open upgraded storage; going back needs a copy of the data directory taken before the upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The new rust-dashcore wraps secp256k1 keys in EcdsaSecretKey and EcdsaPublicKey, returns secret bytes as Zeroizing, and drops the Secp256k1 context argument. Signers, single-key wallets, DashPay derivation, address and QR handling, migrations and their tests follow the new types. Signing stays on the non-grinding dpp::secp256k1 path, and a parity test pins the BLS signature bytes the previous SDK made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Handle the dpp and SDK types the new pin adds, keeping today's behaviour: - Document replace keeps moderated_at and moderated_by; new documents start without them. - The document editor refuses typed-array fields instead of dropping their contents, and keeps referenced key ids as numbers. - Shielded token events show read-only in group actions, and the shielded pool token settings are refused before anything is signed. - Contested document creation states the protocol's base contest fund, so the SDK never auto-quotes a larger one. - Masternode vote reads use ResourceVoteWithCount, the SDK's new vote type; the vote count is not used yet. - New query fields, wallet events, wallet error variants and asset-lock funding modes are handled where the SDK now requires them. - Entropy-only document ids are documented as placeholders from protocol 14, and deferred upstream features link to their issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The SDK was pinned to the protocol 13 table, so it could not build any protocol 14 transition or follow the versioned identity lookup. It now starts at upstream's per-network minimum and ratchets to what proven responses report. - System contracts are cached per protocol version and served through accessors. The context provider serves them at the version the proof verifier asks for and fails rather than serve another version's. - A proved epoch sets the fee multiplier and raises the protocol version. An older epoch than the adopted one is ignored. - Rebuilding the connection resets the protocol version, fee multiplier and adopted epoch under one lock before the new SDK is published, and drops reads begun on the old connection. - Capabilities read the network's version through a helper that stays closed for a version this build does not define. - Contest timing reads the live version; retired vote schedules keep the protocol 13 notice window they were created under. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Compare the protocol 13 client tables with a recorded snapshot, so an upstream change to them is reviewed, and check that keys and documents DET builds on a protocol 13 network use encodings protocol 13 decodes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Map the refusals the new protocol adds to flows DET already offers to dedicated TaskError variants: a full username contest, a vote choice the contest does not allow, a name someone else asked for first, a token that cannot be moved, a changed immutable document field, a reference to a document type that cannot be deleted, and a moderators' fee on a contract without moderation. Names supplied by the node stay in the typed source only, never in the message. Token operations that fail inside the wallet runtime keep their SDK cause, so they are classified like any SDK error; an unclassified one names the operation that did not complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Add a dated design note for the pin, the protocol version sources, the connection state rules and the protocol 13 guards, and point AGENTS.md at From<SdkError> for TaskError as the SDK error reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…transfer Protocol version 14 lets a token configuration make a token non-transferable, and Platform refuses every transfer of such a token. - My Tokens no longer offers Transfer for a token that cannot be transferred; the disabled button says why. - The token creator offers "Holders can send this token to other identities", on by default. Turning it off uses upstream TokenConfiguration::set_transferable, which moves to a version 1 configuration only for a non-transferable token, so a transferable token keeps the version 0 format older networks accept. - The option is gated on a new NonTransferableTokens capability: the connected protocol version must decode version 1 token configurations. The creator and the backend both refuse a non-transferable token on a network that does not, before anything is signed. - Platform's refusal of a tradeable non-transferable token maps to a dedicated, actionable error. - User story TOK-020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…it refusals Protocol version 14 refusals that flows already in DET can hit get dedicated, actionable messages, each keeping the SDK error as its source: - an identity banned or suspended (until when) on a moderated contract; - a gas sponsor short of credits, a gas payer the document type does not offer, and mixed gas payers in one batch; - pre-programmed token distributions of one time over the limit. An overflowing shielded note total is logged at warn: it means corrupt or hostile sync data, not routine noise. Tests cover contracts saved at protocol 12 loading unchanged at 13 and 14, and contracts saved at 14 decoding at 13 and in full again at 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…efusals from the Platform bump Merges 74695e7 from chore/bump-platform-063589bf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
A lookup at another version, as the proof verifier makes at a response's version, swapped out the app's set, so each such lookup reloaded the system contracts and the next app read reloaded them again. Each version now keeps its own set; the app's reads keep the set they last got for a failed reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…poch When the epoch cannot be read, the proved DPNS fallback confirmed the SDK's version, which starts at the network's upstream minimum (14 on devnet), as the network's. It now confirms the version of the responses the SDK verified, and nothing before any. Restores the completed-withdrawal status list with the reason sending FAILED to a protocol 13 network is safe, and its test, now comparing the protocol 13 schema with the latest one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The derived key DET signs with is copied into secp256k1's own type, which keeps its bytes after use. Wrap it so it is erased on drop, as the derived key it comes from would be; signatures stay byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
… protocol 13 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The new refusals sent users to another document editor or token client. They now say the app cannot edit this field type, sign this action or change this token setting yet, in one wording, and the shielded setting refusal sits with the token contract errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Also corrects the platform compatibility fixtures README: no code reads e3cd7cf.sql any more; it is the V001-V018 checksum reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Capability::NonTransferableTokens opens from protocol version 14 through known_protocol_version_at_least, like every other protocol capability, instead of probing the token configuration format version (which feature_gate.rs itself warns against). The token creator's local refusal and disabled-checkbox hint reuse TaskError::NonTransferableTokenNotSupported's text instead of copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…ferable token branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The protocol version fallback takes only a version the SDK verified, and a mock expectation's metadata is never recorded as verified, so the three headless refresh tests saw the version stay unconfirmed. The mock now has the SDK accept the version from metadata treated as proved, as after a live network's signed response, and a new test pins that a response the SDK never verified leaves the version unconfirmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The SDK picks each transition's encoding from the platform version DET passes in, so these tests checked dpp's version tables rather than DET. The mainnet start version and the contest fund cap stay covered by the platform_info and fee_estimation tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The SDK at this pin already tracks the version the network has proven: it records the version of every response whose proof and quorum signature it verified, and a rebuilt connection is a new SDK that starts from nothing. DET's own copy, raised from proved epochs and DPNS reads and reset on every rebuild, duplicated that state. The app now reads the current SDK's verified version; capabilities still stay closed before a version is proven and for one this build does not define, and network info shows the proven number or says none is confirmed. Proved epochs still set the fee multiplier, in epoch order and only on the current connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
A connection rebuild never changes the chain, the multiplier changes once per epoch and feeds only fee estimates, so ordering epoch reads and dropping those begun before a rebuild guarded against nothing worth the machinery. A proved epoch read sets the multiplier directly again; an unavailable epoch still keeps the last known value and labels it as such. A rebuild still reads the epoch, so the new SDK proves the network's version again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
A released protocol's tables and each network's minimum version are upstream's to keep fixed; DET's start is covered by platform_version_starts_at_the_network_minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The proof verifier asks for contracts at the version it verifies with, which can be newer than the SDK's. System contracts were already served at that version; a saved user contract was decoded at the SDK's version instead, dropping newer-protocol settings such as action fees. The fallback now decodes it at the version asked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…king Building the recoverable-signature envelope returns an error upstream; it is now reported as the existing message-signing failure, with the detail logged, instead of aborting the signing path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…rable The squash commit's tree equals #1114's final head, which this branch already contains, so the tree is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
|
Waiting for bot review — coderabbitai not yet · thepastaclaw requested changes — dismiss the review or push a fix. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (no Phase 1 for this repository)
The preset caching and wallet-popup reset fixes are valid, but token-registration results still are not correlated with the registration that produced them. A late result from the old network can be accepted after a new-network registration has entered the same waiting state, so this remains a blocking issue; the cached JSON popup is a separate non-blocking reset omission. Test Suite and Clippy checks were still in progress at the captured head.
🔴 1 blocking | 🟡 1 suggestion(s)
1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial UI state-management and navigation change with broad token-creator behavior coverage, but it does not directly modify funds movement, cryptography, consensus, network deserialization, or storage migrations. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/ui/tokens/tokens_screen/mod.rs`:
- [SUGGESTION] src/ui/tokens/tokens_screen/mod.rs:2447-2450: Clear the cached contract JSON when resetting the creator
`reset_for_network_switch()` calls `reset_token_creator()`, but the reset leaves `show_json_popup` and `json_popup_text` unchanged. If the Advanced-mode View JSON window is open during a network switch, the old network's contract JSON remains visible beside the freshly reset creator. Clear this derived modal state with the other cached creator state.
- [BLOCKING] src/ui/tokens/tokens_screen/mod.rs:2314-2319: Ignore token-creation results from before a network switch
(existing thread: https://github.com/dashpay/dash-evo-tool/pull/1130#discussion_r4380211827)
The new guard only checks whether the current creator is in `WaitingForResult`; it does not identify which registration or network that wait belongs to. After a network switch, `reset_for_network_switch` changes the old creator to `NotStarted`, but the user can start a new registration on the new network before the old task completes. The old success result is then routed as `BackendTaskContext::Other`, passes `awaits_token_registration()`, and changes the new creator to `Complete`; the matching failure path in `display_message` has the same race. The unconditional `operation_banner.take_and_clear()` also clears the new registration's progress banner when the stale success arrives. Correlate each registration with a generation, request identifier, or network and discard results and errors whose identifier does not match the current registration.
Advanced mode's "View JSON" popup survived the Token Creator reset, so after a network switch (or a finished creation) it could still show the contract built from the previous form. The reset now closes it and drops its text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
|
Waiting for bot review — coderabbitai not yet · thepastaclaw requested changes — dismiss the review or push a fix. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (no Phase 1 for this repository)
The creator reset, popup cleanup, cached preset rules, and wallet-popup handling are fixed at this head. However, registration results are still correlated only by the mutable WaitingForResult status: after a network switch and a new registration, a late result from the old network can complete the new creator, while a stale error can still reach the global banner because TokensScreen does not suppress outdated backend errors. Clippy and the test suite were still in progress in the supplied CI snapshot.
🔴 1 blocking
1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial Rust UI state-management change spanning navigation, form persistence, network switching, and extensive tests, but it does not directly change a critical surface such as funds movement, cryptography, consensus, or storage migrations. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/ui/tokens/tokens_screen/mod.rs`:
- [BLOCKING] src/ui/tokens/tokens_screen/mod.rs:3148-3152: Ignore token-creation results from before a network switch
(existing thread: https://github.com/dashpay/dash-evo-tool/pull/1130#discussion_r4380211827)
The `awaits_token_registration()` guard only checks the current status, not which registration request or network produced the result. If registration A starts on network A, the user switches to network B, and then starts registration B before A finishes, the creator is again `WaitingForResult`; A's late `RegisteredTokenContract` result is therefore accepted here and changes registration B's creator to `Complete`. The error path has the same correlation gap: `display_message` changes the status only when it is waiting, but TokensScreen does not override `should_suppress_backend_task_error`, so a stale failure can still be displayed as a global error banner. Carry a reset/request generation or network-bound registration identity through the result and error routing, and discard results from invalidated registrations before they affect the current creator or its banners.
|
On the remaining blocker, a stale registration result after a network switch ( #1100 fixes this in result routing, for every screen. It records the network each request was dispatched on ( This PR still handles the part it can: a stale result that arrives while the creator is not waiting is ignored. 🤖 Co-authored by Claudius the Magnificent AI Agent |
Dismissed by the maintainer: the remaining blocker (stale registration result after a network switch) is a result-routing issue fixed for every screen in #1100. See the PR comment.
|
@thepastaclaw review No review for |
|
Waiting for bot review — coderabbitai skipped after its own rate limit · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
Ready for review — files with no dedicated owner: lklimek. |
|
Policy satisfied — this can merge. |
TL;DR
If you left the Token Creator and came back, the whole form was wiped, but the preset selector kept showing "All Allowed" while every action rule had been reset to "no one". Clicking Create Token then registered a token that nobody can ever mint, burn, freeze, pause or reconfigure.
Now:
User story
As a token creator, I fill in the form and pick a permissions preset. Then I realize I need to top up my identity first. I go do that and come back to find everything still there. The token that gets registered has exactly the permissions the screen shows, and I never have to toggle the dropdown to make them apply.
Scenario
Before this change:
Toggling to another preset and back before step 4 re-applied the rules, which is why that workaround helped.
After this change, step 3 shows the form exactly as you left it, and the rules match the shown preset.
Live evidence (testnet, read-only, decoded
DataContractCreatetransitions), owner33fx2tgSgSR2bRkTCkC7E145arjfLcd2mfmrcq8KfzQ2:CSFhsj9v…), broken8gPS4Dq…), after toggleauthorizedToMakeChange/adminActionTakersNoOne/NoOneContractOwner/ContractOwnerchangingAuthorized…ToNoOneAllowed,changingAdmin…ToNoOneAllowed,selfChangingAdmin…Allowedfalse×3true×3mainControlGroupCanBeModifiedNoOneContractOwnerThe table covers these rules: manual mint and burn, freeze, unfreeze, destroy frozen funds, emergency action, max supply change, conventions change and marketplace trade mode. Token 001's rules are exactly
ChangeControlRulesV0::default(), which is what the form reset wrote. Token 002's rules are Platform'sWithExtremeActions("All Allowed") preset. Apart from these rules, the two contracts differ only in name, base supply and nonce.Detailed discussion
Stacked atop #1118 (
feat/token-non-transferable).Root cause. The creator screen emits
SetMainScreenThenGoToMainScreenfor every subscreen tab and left-panel click, and on each oneTokensScreen::reset_token_creator()ran. It reset every rule field to its default,NoOne, but never clearedselected_token_preset. Both preset selectors render that field, and Simple mode's Create Token gate only checked whether it was set. The label, the gate and the built rules therefore disagreed. A truly fresh creator shows "Select a preset...", so the "default All Allowed" the user saw was this leftover label.Fix (
src/ui/tokens/tokens_screen/{token_creator.rs,mod.rs},src/ui/mod.rs):Complete, i.e. leaving the success screen). The success screen's Back button still resets as before. A creation still in flight is unaffected: its result is delivered to the creator screen whether or not it is on screen, so you come back to the success screen.Screen::change_contextnow has a dedicatedTokensScreenarm that callsreset_for_network_switch(). The form's identity, key and wallet belong to the previous network. Previously a network switch only swapped the context and left the old network's identity in the form. The reset also closes the wallet unlock popup, which belonged to the previous network's wallet. A registration that was still running when the network changed cannot complete the new network's creator: the creator accepts a registration result only while it is waiting for one.TokenPresetSelection:Unselectedshows "Select a preset...". Simple mode keeps Create Token disabled, as before.Preset(f)shows the preset's name.Customshows "Custom" in both Simple and Advanced mode. It is a valid choice for Create Token, and the token is built from the rules as they are.PresetRules::from_presetmaps a Platform preset to the creator's 13 change-control rules and the main-control-group rule.change_to_presetapplies it, andreconcile_selected_preset()compares against it at the top of every render. Once the rules stop matching the shown state, the selector switches toCustom. That happens after a single rule edit following a preset choice, or after a rule edit before any choice, whichPresetRules::initial()detects. The special-case marketplace and direct-purchase branches for "Most Restrictive" were dropped because they were identical to that preset's advanced rules. The rules of each of the five presets, and of the untouched form, are derived once and cached (LazyLock), so the check that runs every frame builds nothing.allow_transfers_to_frozen_identities,new_tokens_destination_identity_should_default_to_contract_ownerandperpetual_dist_interval_unit."Please select a {missing}".Preset audit: what every preset builds now equals Platform's own preset.
PresetRules::from_presetreads every value from upstreamTokenConfigurationPreset::token_configuration_v0(built "with direct pricing") instead of a hand-written mapping. The old mapping had drifted from Platform in three places:minting_allow_choosing_destination(a mint may send to a chosen identity)falsetrueNoOne→ owner)NoOne→ owner)All other change-control rules and the main-control-group rule were already identical. The choosing-destination switch now also counts in preset matching, so turning it off after picking a preset shows "Custom".
Deliberately kept:
new_tokens_destination_identityunset, but the creator has always defaulted it to the owner.NotTradeablein both.Same "shown ≠ built" pattern found elsewhere on the Token Creator:
The other dropdowns are bound directly to the values that get built: distribution type, interval unit, function, recipient, name language and rule takers.
Already-created tokens. e2e-test-001 cannot be repaired on-chain. Platform rejects any change to an existing token's configuration through a contract update (
validate_update_tokens). The token's own config-update rules nameNoOneas both the authorized and the admin action taker, so no identity can ever change them. Transfers still work. The token is permanently fixed-supply with no admin actions.Advanced mode gate and visible reasons: Register Token Contract in Advanced mode is now blocked while the selector is
Unselected, just like Simple mode's Create Token. A named preset and "Custom" are both allowed, so an untouched creator can no longer register its all-"no one" starting rules by accident.Whenever either button is blocked, the reason appears as a visible hint next to the button and also as its
disabled_tooltip:Known limitation: app-wide, the result of a task sent before a network switch is delivered to whichever screen is in view, and nothing ties it to the network it was sent on (
finalize_network_switchclearsrequest_owners). This is also the case onv1.0-dev. This PR closes that gap only for the Token Creator; tagging each request with its network in the app's result routing is left for a follow-up.Testing
Unit tests in
src/ui/tokens/tokens_screen/mod.rs:token_creator_form_and_preset_survive_navigation: name, description, paused flag, identity, preset and Create Token gate all survive the navigation handler. The built rules equal "All Allowed".token_creator_preset_shown_after_navigation_reset_is_the_one_built), was RED before the fix with the exact on-chain symptom:manual minting rules differ from the WithExtremeActions preset shown on screen — left: NoOne/NoOne/false/false/false, right: ContractOwner/ContractOwner/true/true/true.token_creator_starts_fresh_after_a_successful_creation: afterRegisteredTokenContractand leaving, the creator has no preset and Create Token is blocked even with the other fields filled. The cached dialog and missed defaults are reset.token_creator_starts_fresh_after_a_network_switch.network_switch_closes_the_wallet_unlock_popup.registration_result_from_before_a_network_switch_is_ignored: a registration waiting when the network changes cannot complete or fail the new network's creator. RED before the fix (left: Complete).token_creator_builds_exactly_the_selected_preset: for all five presets, a creator with no preset blocks Create Token, and each picked preset is built exactly as Platform'sTokenConfigurationPresetdefines it. That includes marketplace, direct purchase pricing, distribution rules and main control group.token_creator_shows_custom_when_rules_leave_the_preset: one rule edit shows "Custom", Create Token stays allowed, and the edited rule is built while untouched rules keep the preset's values. Re-selecting the preset re-applies it. A main-control-group edit also switches to Custom.token_creator_rule_edit_without_preset_is_custom.blocked_reasons_name_the_preset_before_transferability: the preset reason comes first in both modes, then feat(tokens): create non-transferable tokens and stop offering their transfer #1118's non-transferable reason, and nothing blocks once both are resolved.token_creator_presets_build_platforms_full_preset_configuration: table-driven over all five presets. It builds the actual data contract and compares the entireTokenConfigurationV0with Platform'stoken_configuration_v0for that preset; only the documented owner-as-default destination differs. RED before the audit fix withminting_allow_choosing_destination: falseinstead oftrue.Kittest
tests/kittest/tokens_screen.rs::token_creator_form_survives_left_panel_and_tab_navigationdrives the real app: it types the name, description and supply and picks All Allowed. Then it does two round trips:After each round trip it asserts that the inputs, the "All Allowed" selection and the enabled Create Token button are all still there. A mutation check that restored the old unconditional reset made it fail with "the token name must survive a left-panel round trip".
Kittest
tests/kittest/tokens_screen.rs::advanced_register_requires_a_preset_choicefills the form and switches to Advanced mode, then checks two things:It was RED on the code without the gate (it failed with "the blocked button must say why").
Results:
cargo test --all-features --lib ui::tokens::tokens_screen::: 25/25 passed.cargo test --all-features --test kittest tokens_screen::: 6/6 passed (including the tests fromv1.0-dev).cargo clippy --all-features --all-targets -- -D warnings: clean.cargo fmt --all: run.Not verified: the GUI was not driven on a real display (kittest only), and no token was created or broadcast.
🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
PR Hygiene ·
4120935src/ui/mod.rs,src/ui/tokens/tokens_screen/mod.rs,src/ui/tokens/tokens_screen/token_creator.rsand 1 more) — approved by lklimekWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.