Skip to content

[#23] Token price display on story page#71

Merged
realproject7 merged 2 commits intomainfrom
task/23-token-price-display
Mar 14, 2026
Merged

[#23] Token price display on story page#71
realproject7 merged 2 commits intomainfrom
task/23-token-price-display

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • P5-1a: New lib/price.ts — reads current token price and reserve balance from MCV2_Bond using priceForNextMint and tokenBond view functions
  • P5-1b: Story page header now displays token price and reserve balance in a 2-column info card
  • All contract addresses imported from lib/contracts/constants.ts (no hardcoding)
  • Reserve label adapts: WETH on testnet, $PLOT on mainnet

Fixes #23

Test plan

  • Verify price card renders on story pages with bonded tokens
  • Verify graceful fallback (no price card) for tokens without a bond
  • Verify testnet shows "WETH", mainnet shows "$PLOT"
  • npm run lint and npm run typecheck pass

🤖 Generated with Claude Code

Fixes #23

- P5-1a: Create lib/price.ts — reads current token price and reserve
  balance from MCV2_Bond via priceForNextMint and tokenBond view functions
- P5-1b: Display token price and reserve balance on story page header
- Uses MCV2_BOND address from lib/contracts/constants.ts (no hardcoding)
- Reserve label adapts to testnet (WETH) vs mainnet ($PLOT)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified:

  • MCV2_BOND and IS_TESTNET correctly imported from constants.ts (no hardcoded addresses)
  • Reserve label adapts correctly (WETH/testnet, $PLOT/mainnet)
  • Server-side price fetch with graceful null fallback (no price card when bond doesn't exist)
  • Parallel multicall for priceForNextMint + tokenBond is efficient
  • ABI destructuring correctly skips to reserveToken and reserveBalance fields

Minor note: pricePerToken/reserveBalance could display long decimal strings (e.g. "0.000000000000001234") — consider truncating to 4-6 significant digits in a follow-up for cleaner UX. Not blocking.

Approved.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The PR adds a token price card and uses the shared contract constants correctly, but it does not satisfy the issue acceptance criteria for the second field on the story page.

Findings

  • [medium] Issue #23 explicitly calls for displaying the current price and the total supply minted, but the new utility only reads reserveBalance from tokenBond() and the story page renders that as Reserve instead. That means the required minted-supply value is still missing, so the PR does not fully implement P5-1b.
    • File: lib/price.ts:27
    • Suggestion: Extend the on-chain read path to fetch the token's minted supply from the appropriate contract/view, return it from TokenPriceInfo, and render that value on the story page instead of reserve balance.

Decision

Requesting changes because the story page currently shows the wrong metric for the second data point required by issue #23.

Reads ERC-20 totalSupply() on the storyline token instead of
reserveBalance from tokenBond(), matching the issue requirement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Correctly replaced reserve balance with ERC-20 totalSupply on the storyline token — matches issue #23 spec. ABI simplified, interface cleaned up, UI label updated to "Supply Minted". Approved.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The story page now shows the required token price and minted supply metrics, and the implementation still uses the shared contract constants and testnet/mainnet reserve label handling correctly. lint-and-typecheck is passing.

Findings

  • none

Decision

Approving because the PR now satisfies issue #23 without the earlier metric mismatch.

@realproject7 realproject7 merged commit 5aebda2 into main Mar 14, 2026
1 check 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

Development

Successfully merging this pull request may close these issues.

[P5-1] Token Price Display

2 participants