Skip to content

feat: token lookup, extended event feed, contract upgrade UI - Fix #3…#318

Merged
zachyo merged 2 commits into
soropad:masterfrom
Biokes:fix/issues-299-305-306
Jun 30, 2026
Merged

feat: token lookup, extended event feed, contract upgrade UI - Fix #3…#318
zachyo merged 2 commits into
soropad:masterfrom
Biokes:fix/issues-299-305-306

Conversation

@Biokes

@Biokes Biokes commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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 feature
  • fix — bug fix
  • refactor — code change that neither fixes a bug nor adds a feature
  • perf — performance improvement
  • test — adding or updating tests
  • docs — documentation only
  • ci — CI / workflow changes
  • chore — dependency bump or tooling update

Scope

  • Contract (contracts/)
  • Frontend / Web (frontend/)
  • Docs (docs/)
  • CI / Ops (.github/)

Changes

Fix #306 — Landing page: look up / discover any token by contract ID

Files: frontend/app/page.tsx

The 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.

  • Added a search/lookup input to the hero section
  • Input validated against ^C[A-Z2-7]{55}$ (Stellar contract ID format) before navigation
  • On valid submit, routes to /token/<contractId>
  • Inline error state for empty or malformed input
  • Gracefully handles both contract IDs (C…) with a clear validation message

Fix #305 — Activity feed & indexer only decode 4 event types

Files: frontend/lib/stellar.ts, frontend/hooks/useContractEvents.ts, frontend/app/dashboard/[contractId]/ActivityFeed.tsx

The activity feed and indexer subscribed to only transfer, mint, burn, and clawback. 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:

  • Added TokenActivityType union type covering all 13 event topics: mint, transfer, burn, clawback, freeze, unfreeze, pause, unpause, authorize, unauthorize, set_admin, revoke_admin, upgrade, other
  • Added subject?: string field to TokenActivityInfo for the address involved in admin/compliance events
  • Added TRACKED_EVENT_TOPICS constant (single source of truth for all subscribed topics)
  • Added decodeActivityEvent() helper with a full switch over all event types
  • Extended fetchAccountOperations() to subscribe to all 13 topics via the indexer and use decodeActivityEvent() for decoding
  • fetchTransactionHistory() 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:

  • Rewrote the poll loop with a full switch decoder matching all 13 topics
  • Unknown topics are now labelled other and kept rather than dropped
  • Extracts subject (account address) from freeze/unfreeze/authorize/unauthorize/set_admin/revoke_admin events

frontend/app/dashboard/[contractId]/ActivityFeed.tsx:

  • Added per-type icons: ❄️ freeze/unfreeze, ⏸ pause/unpause, 🛡 authorize/unauthorize, 👤 set_admin/revoke_admin, ⬆ upgrade
  • Added getTypeLabel() with human-readable labels ("Account frozen", "Token paused", "Admin set", etc.)
  • "From" column falls back to subject for admin/compliance events that have no from/to address

Fix #299 — AdminPanel: Contract upgrade UI

Files: frontend/app/dashboard/[contractId]/components/AdminPanel.tsx, frontend/app/dashboard/[contractId]/TokenDashboard.tsx

There 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.

  • Added an Advanced / Danger section at the bottom of the Admin Console
  • Shows the is_locked() state — if locked, the upgrade card is disabled and explains the contract is immutable
  • 64-character hex input for the new WASM hash with client-side regex validation (/^[0-9a-fA-F]{64}$/)
  • Typed-symbol confirmation modal: user must type the token symbol before the upgrade transaction is submitted
  • Audit warning banner explaining the upgrade replaces contract logic for all holders
  • Uses the existing sign → simulate → assemble → submit flow consistent with all other admin actions
  • Added tokenSymbol prop to AdminPanelProps; TokenDashboard passes tokenInfo.symbol

Files changed

File Change
frontend/app/page.tsx Add contract ID lookup input to hero
frontend/lib/stellar.ts TokenActivityType, TRACKED_EVENT_TOPICS, decodeActivityEvent(), extended indexer subscriptions
frontend/hooks/useContractEvents.ts Full event decoder rewrite, all 13 topics
frontend/app/dashboard/[contractId]/ActivityFeed.tsx Per-type icons, human labels, subject column
frontend/app/dashboard/[contractId]/components/AdminPanel.tsx Upgrade Contract section, tokenSymbol prop
frontend/app/dashboard/[contractId]/TokenDashboard.tsx Pass tokenSymbol to AdminPanel

Testing

Manual checklist

  • Landing page: paste a valid contract ID → routes to /token/<id>
  • Landing page: paste an invalid string → shows inline error, no navigation
  • Landing page: submit empty input → shows "Paste a contract ID" error
  • Activity feed: trigger a pause on testnet → event appears with "Token paused" label and ⏸ icon
  • Activity feed: trigger a freeze → event appears with "Account frozen" label and the frozen address in the From column
  • Activity feed: trigger set_admin → event appears with "Admin set" label and new admin address
  • Activity feed: unknown event topics are labelled "Other" and not dropped
  • Admin Console: locked contract → upgrade card disabled with lock message
  • Admin Console: enter a 64-char hex hash → confirmation modal appears requesting token symbol
  • Admin Console: type wrong symbol → upgrade blocked
  • Admin Console: type correct symbol → upgrade() transaction submitted

Breaking changes

None. All changes are additive:

  • TokenActivityInfo.subject is optional
  • TokenActivityType is a superset of the previous "mint" | "transfer" | "burn" | "clawback" | "other" union
  • AdminPanelProps.tokenSymbol is optional with a safe fallback

Closes #306
Closes #305
Closes #299

…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
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@zachyo zachyo merged commit 2473a2e into soropad:master Jun 30, 2026
0 of 2 checks passed
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