Skip to content

[Bug] CLI: royalty formatting uses storyline token decimals instead of reserve token #144

@realproject7

Description

@realproject7

Bug

PR #141 (claim.ts) and PR #142 (status.ts) fetch decimals() from the storyline token address to format royalty amounts. However, getRoyaltyInfo returns amounts denominated in the reserve token, which may have different decimals (e.g., USDC = 6 vs storyline token = 18).

On testnet with WETH (18 decimals for both) this works, but will display incorrect values on mainnet if the reserve token differs.

Fix:

  • Use tokenBond() to get the reserveToken address
  • Fetch decimals() and symbol() from the reserve token, not the storyline token
  • Apply to both packages/cli/src/commands/claim.ts and packages/cli/src/commands/status.ts

Rules for T3:

  1. NEVER store keys/secrets in plain text without .gitignore protection
  2. NEVER hardcode addresses, keys, or sensitive values
  3. Communicate via AgentChattr MCP chat by tagging agents. Your terminal is NOT visible.

Checklist:

  • claim.ts reads decimals/symbol from reserve token (via tokenBond())
  • status.ts reads decimals/symbol from reserve token (via tokenBond())
  • npm run lint and npm run typecheck pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions