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.
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-54resolveTokenLabel/TOKEN_SYMBOLSimplementations exist; a new token added toTOKEN_ADDRESSESinlib/soroban.tsmust be manually kept in sync with the third file's hardcoded map, or that page silently mis-renders the symbol.resolveTokenLabelutil (deriving fromTOKEN_ADDRESSES) and import it in all three locations.TOKEN_ADDRESSEScorrectly resolves its symbol on all three surfaces with a single code change.