feat: token lookup, extended event feed, contract upgrade UI - Fix #3…#318
Merged
Conversation
…ropad#306: add contract ID search/lookup input to landing page hero - Validate against ^C[A-Z2-7]{55}$ Stellar contract ID regex - Route to /token/<id> on valid submit - Graceful error state for invalid input - Fix soropad#305: extend activity feed to decode all admin/compliance events - Add TokenActivityType union with freeze/unfreeze, pause/unpause, authorize/unauthorize, set_admin, revoke_admin, upgrade, other - Add TRACKED_EVENT_TOPICS constant and decodeActivityEvent() helper in stellar.ts - Extend fetchAccountOperations() and fetchTransactionHistory() to subscribe to all 13 topic types via indexer - Rewrite useContractEvents.ts poll loop with full switch decoder - Add subject field to TokenActivityInfo for admin/compliance events - ActivityFeed.tsx: per-type icons, human labels, subject column fallback - Fix soropad#299: Upgrade Contract UI in AdminPanel - Advanced/Danger section with WASM hash input (64-char hex validation) - is_locked() guard — disables upgrade when contract is immutable - Typed-symbol confirmation modal before submitting upgrade() - Audit warning banner; uses existing sign/submit flow - Pass tokenSymbol prop from TokenDashboard to AdminPanel Closes soropad#306 Closes soropad#305 Closes soropad#299
|
@Biokes 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! 🚀 |
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.
Summary
Fixes three issues: token discovery from the landing page (#306), invisible admin/compliance events in the activity feed (#305), and a missing contract upgrade UI (#299).
Type of change
feat— new featurefix— bug fixrefactor— code change that neither fixes a bug nor adds a featureperf— performance improvementtest— adding or updating testsdocs— documentation onlyci— CI / workflow changeschore— dependency bump or tooling updateScope
contracts/)frontend/)docs/).github/)Changes
Fix #306 — Landing page: look up / discover any token by contract ID
Files:
frontend/app/page.tsxThe landing page had no way to navigate to a token unless it appeared in the recent launches list (capped at 12, ~24h window). Tokens with a known contract ID were unreachable without hand-editing the URL.
^C[A-Z2-7]{55}$(Stellar contract ID format) before navigation/token/<contractId>C…) with a clear validation messageFix #305 — Activity feed & indexer only decode 4 event types
Files:
frontend/lib/stellar.ts,frontend/hooks/useContractEvents.ts,frontend/app/dashboard/[contractId]/ActivityFeed.tsxThe activity feed and indexer subscribed to only
transfer,mint,burn, andclawback. All admin and compliance events emitted by the contract were silently dropped — an admin who paused a token or froze an account left no visible audit trail in the UI.frontend/lib/stellar.ts:TokenActivityTypeunion type covering all 13 event topics:mint,transfer,burn,clawback,freeze,unfreeze,pause,unpause,authorize,unauthorize,set_admin,revoke_admin,upgrade,othersubject?: stringfield toTokenActivityInfofor the address involved in admin/compliance eventsTRACKED_EVENT_TOPICSconstant (single source of truth for all subscribed topics)decodeActivityEvent()helper with a fullswitchover all event typesfetchAccountOperations()to subscribe to all 13 topics via the indexer and usedecodeActivityEvent()for decodingfetchTransactionHistory()now uses the full topic list for the indexer subscription (still filters to transfer-type items for the chart/history view)frontend/hooks/useContractEvents.ts:switchdecoder matching all 13 topicsotherand kept rather than droppedsubject(account address) from freeze/unfreeze/authorize/unauthorize/set_admin/revoke_admin eventsfrontend/app/dashboard/[contractId]/ActivityFeed.tsx:getTypeLabel()with human-readable labels ("Account frozen", "Token paused", "Admin set", etc.)subjectfor admin/compliance events that have no from/to addressFix #299 — AdminPanel: Contract upgrade UI
Files:
frontend/app/dashboard/[contractId]/components/AdminPanel.tsx,frontend/app/dashboard/[contractId]/TokenDashboard.tsxThere was no UI to call
upgrade(new_wasm_hash)on the token contract. Admins had to drop to the Soroban CLI, with no in-app visibility of whether the contract was already locked/immutable.is_locked()state — if locked, the upgrade card is disabled and explains the contract is immutable/^[0-9a-fA-F]{64}$/)sign → simulate → assemble → submitflow consistent with all other admin actionstokenSymbolprop toAdminPanelProps;TokenDashboardpassestokenInfo.symbolFiles changed
frontend/app/page.tsxfrontend/lib/stellar.tsTokenActivityType,TRACKED_EVENT_TOPICS,decodeActivityEvent(), extended indexer subscriptionsfrontend/hooks/useContractEvents.tsfrontend/app/dashboard/[contractId]/ActivityFeed.tsxfrontend/app/dashboard/[contractId]/components/AdminPanel.tsxtokenSymbolpropfrontend/app/dashboard/[contractId]/TokenDashboard.tsxtokenSymboltoAdminPanelTesting
Manual checklist
/token/<id>pauseon testnet → event appears with "Token paused" label and ⏸ iconfreeze→ event appears with "Account frozen" label and the frozen address in the From columnset_admin→ event appears with "Admin set" label and new admin addressupgrade()transaction submittedBreaking changes
None. All changes are additive:
TokenActivityInfo.subjectis optionalTokenActivityTypeis a superset of the previous"mint" | "transfer" | "burn" | "clawback" | "other"unionAdminPanelProps.tokenSymbolis optional with a safe fallbackCloses #306
Closes #305
Closes #299