[#177] Fix reader dashboard: RESERVE_LABEL + truncated decimals#181
[#177] Fix reader dashboard: RESERVE_LABEL + truncated decimals#181realproject7 merged 2 commits intomainfrom
Conversation
Replace hardcoded "$PLOT" with RESERVE_LABEL (WETH on testnet) and truncate formatUnits output to 6 decimal places for readability. Fixes #177 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Clean fix:
formatTruncated— String-based truncation afterformatUnits. Correctly strips trailing zeros and trailing dot. Good approach avoiding floating-point issues.- RESERVE_LABEL — Replaces hardcoded "$PLOT". Applied to both total and per-row amounts.
No issues.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The label fix is correct, but the reader dashboard still formats donation amounts with a hardcoded 18 decimals in both donation-history display paths. This repo already uses dynamic reserve-token metadata elsewhere, and the queue rules explicitly say not to hardcode values.
Findings
- [medium] Donation history still hardcodes reserve-token decimals via
formatTruncated(..., 18)for both the page total and each donation row. That keeps this screen out of sync with the app's dynamic reserve-token formatting pattern and can misformat values if the reserve token decimals ever differ.- File:
src/app/dashboard/reader/page.tsx:105 - Suggestion: Fetch the reserve token decimals dynamically (for example via the same
getTokenTVL/ token-bond metadata path already used in the dashboard and portfolio code) and pass those decimals intoformatTruncatedinstead of hardcoding18.
- File:
Decision
Requesting changes because PR #181 fixes the label but leaves hardcoded reserve-token decimals in the reader dashboard donation history. The formatting should follow the existing dynamic metadata pattern before this is approved.
Fetch PLOT_TOKEN decimals on-chain via publicClient and pass to formatTruncated calls. Falls back to 18 if query hasn't resolved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up commit removes the hardcoded 18 decimals from the reader dashboard donation-history display and resolves the reserve-token decimals dynamically instead. That closes the formatting issue while keeping the WETH/$PLOT label fix intact.
Findings
- [info] No remaining blocking findings after
949b292.- File:
src/app/dashboard/reader/page.tsx:63 - Suggestion: None.
- File:
Decision
Approving because the prior hardcoded-decimals issue is resolved, the reader dashboard now follows the app's reserve-token metadata pattern, and GitHub lint-and-typecheck is passing.
Summary
RESERVE_LABEL(shows "WETH" on testnet)formatTruncatedhelper to limit decimal output to 6 places (e.g.,0.000577 WETHinstead of0.00057715687791651 $PLOT)Fixes #177
Test plan
tsc --noEmit— zero errorsnext build— clean🤖 Generated with Claude Code