Skip to content

Fix compliance-node gating, authorization lock-in, launch feed accuracy, and locale a11y sync - #434

Merged
zachyo merged 2 commits into
soropad:masterfrom
Majormaxx:fix/issues-411-405-404-403-frontend-and-token-contract
Aug 3, 2026
Merged

Fix compliance-node gating, authorization lock-in, launch feed accuracy, and locale a11y sync#434
zachyo merged 2 commits into
soropad:masterfrom
Majormaxx:fix/issues-411-405-404-403-frontend-and-token-contract

Conversation

@Majormaxx

Copy link
Copy Markdown
Contributor

Summary

  • Closes RecentLaunches misses launches, truncates arbitrarily, and serialises its RPC #411: the landing page's recent-launches feed now probes the RPC's real event-retention window via getHealth().oldestLedger instead of a hardcoded 24h lookback (falling back to the old fixed window if getHealth is unsupported), sorts candidates by ledger before truncating to the top 20 so a busy window doesn't return an arbitrary subset, and runs the activity-scoring RPC batches concurrently instead of one at a time.
  • Closes Token: the compliance node is asked about the token's own address on every mint #405: ComplianceNodeInterface gains a can_issue(to) method that mint/mint_batch call to check only the recipient, with a fallback to the older can_trade(to, to) for compliance nodes that don't implement it yet. Previously mint always asked can_trade(token_contract_address, to), which an allowlist-style node would always reject since the token contract itself is never KYC'd — this blocked all issuance on allowlist-style compliance nodes.
  • Closes Token: the two authorization flags can never be changed after deploy #404: added set_authorization_required(required) and renounce_authorization_revocable() so the admin can toggle the authorization-required gate after deploy, and permanently give up revoke power if they want that one-way guarantee. Previously both flags were write-once at initialize with no way to change them later.
  • Closes <html lang> never follows the selected locale #403: LocaleProvider now syncs document.documentElement.lang/dir to the active locale on mount and on every locale change, so screen readers, "translate this page," and hyphenation/font-fallback work correctly for es/fr/zh instead of staying pinned to en.

Also fixed (prerequisite, found while verifying the above)

contracts/token/src/lib.rs on master currently fails to compile and fails CI on every recent run (verified via gh run list): clawback() called a nonexistent Self::_transfer_clawback, and 3 event topic literals exceeded Soroban's 9-character symbol_short! limit. Fixed as a hard prerequisite since these changes couldn't otherwise be built or tested. Also reconciled EXPECTED_TOPICS and docs/events.json/docs/events.md against the actual emitted topics (a pre-existing doc/fixture drift: "auth" was documented but never emitted, accept_admin's set_admin topic was undocumented) — pure documentation-side fix, no runtime behavior change.

The 3 renamed topic literals (prop_adminprop_adm, revoke_authrvk_auth, update_uriupd_uri) required matching updates in frontend/lib/stellar.ts (TRACKED_EVENT_TOPICS, TokenActivityType, decodeActivityEvent) and frontend/hooks/useContractEvents.ts's duplicate event-topic switch, so the frontend's activity feed keeps decoding real contract events correctly.

Testing

  • cargo test -p soroban-token: 114/114 unit tests + 21/21 fuzz tests passing.
  • cargo test --workspace: all passing (token + vesting + doc-tests).
  • cargo fmt --all -- --check: clean except 2 pre-existing, untouched findings (line 607 in approve, a ~90-line block near line 2615) that predate this branch — left as-is per surgical-diff scope.
  • cargo build -p soroban-token --target wasm32-unknown-unknown --release: clean.
  • python3 scripts/generate_events_doc.py --check: clean.
  • npm run type-check: clean (0 errors).
  • npm run lint: clean (0 errors; pre-existing warnings in untouched files only).
  • npm run test: this sandbox hits an environment-level Jest SIGBUS crash (reproducible on pre-existing, untouched test files too, independent of the changes here) — substituted with tsc --noEmit + eslint + manual test-logic review against the actual implementation for the 2 new test files (recentTokens.test.ts, LocaleProvider.test.tsx).

Test plan

  • CI green on all jobs
  • Deploy a token with a compliance node that only implements can_trade (no can_issue) and confirm mint still works via the fallback
  • Deploy a token with an allowlist-style node implementing can_issue, confirm mint is gated on the recipient only
  • Toggle "Authorization Required" on a deployed token via set_authorization_required and confirm it takes effect immediately
  • Switch locale to es/fr/zh in the browser and confirm <html lang> / dir update and a screen reader announces the correct language

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Majormaxx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Majormaxx

Copy link
Copy Markdown
Contributor Author

Verification summary: contracts — 114/114 unit tests + 21/21 fuzz tests passing, cargo fmt --check clean apart from 2 pre-existing findings outside this diff, wasm release build clean, events doc/fixture check clean. Frontend — tsc --noEmit and eslint both clean; Jest itself hits a sandbox-level SIGBUS unrelated to this change (reproducible on pre-existing untouched tests too), so the 2 new test files were verified by tracing them against the actual implementation instead. Ready for review.

@zachyo
zachyo merged commit 6225d6f into soropad:master Aug 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants