Skip to content

[P5-R3] Add priceForNextMint + tokenBond ABI + 24h price change utility #80

@realproject7

Description

@realproject7

Context

Add two MCV2_Bond view functions to the ABI. Reference: mint.club-v2-web and mintpad both use these patterns.

Functions to Add

priceForNextMint(address token) -> uint128
Simple current price, no amount param needed.

tokenBond(address token) -> (creator, mintRoyalty, burnRoyalty, createdAt, reserveToken, reserveBalance)
Full bond info including TVL (reserveBalance).

24h Price Change Utility (mintpad pattern)

Read priceForNextMint at current block and at currentBlock - 43200n (~24h on Base at 2s blocks). Return percentage change. No database or cron needed — pure on-chain reads.

Acceptance Criteria

  • priceForNextMint and tokenBond added to ABI in lib/contracts/abi.ts
  • New utility: get24hPriceChange(tokenAddress) using block number diff
  • New utility: getTokenTVL(tokenAddress) reading tokenBond().reserveBalance
  • Existing getTokenPrice() updated to use priceForNextMint (simpler)
  • npm run lint and npm run typecheck pass

Reference

  • mintpad: src/helpers/contracts.ts (priceForNextMint + 24h change via block diff)
  • mint.club-v2-web: app/hooks/price/mintclub.ts (priceForNextMint)

Dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions