Skip to content

[Audit] Token-symbol resolution duplicated across three files with no single source of truth #1264

Description

@K1NGD4VID

Filed from the second-wave repository audit (issue 62/100). See the audit summary for full category context.

  • Location: frontend/src/lib/dashboard.ts:71-77, frontend/src/lib/api/streams.ts:36-42, frontend/src/app/streams/[id]/stream-details-content.tsx:50-54
  • Problem: Three independent resolveTokenLabel/TOKEN_SYMBOLS implementations exist; a new token added to TOKEN_ADDRESSES in lib/soroban.ts must be manually kept in sync with the third file's hardcoded map, or that page silently mis-renders the symbol.
  • Evidence: Three separate implementations of the same address→symbol mapping.
  • Suggested implementation: Extract one shared resolveTokenLabel util (deriving from TOKEN_ADDRESSES) and import it in all three locations.
  • Acceptance criteria: Adding a new token to TOKEN_ADDRESSES correctly resolves its symbol on all three surfaces with a single code change.
  • Difficulty: S
  • Expected impact: Removes a silent-drift bug source that only surfaces when a new token is added.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programfrontendFrontend related tasksrefactorRefactoring existing codesecond-wave-auditFiled from the second-wave repo audit (100 issues)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions