Skip to content

[QA-Bug] Writer earnings always zero — getRoyaltyInfo reverts, ABI mismatch #160

@realproject7

Description

@realproject7

Problem

Writer dashboard always shows earnings as "–" (zero) even after multiple trades (18500 tokens bought/sold).

Root cause

getRoyaltyInfo(tokenAddress) on MCV2_Bond (0x5dfA75b0185efBaEF286E80B847ce84ff8a62C2d on Base Sepolia) reverts when called with the storyline token address (0x14262a4576b53d94ef1333b5604e7c99862c05ce).

Additionally, tokenBond() returns misaligned data — the ABI struct fields don't match the deployed contract:

reserveToken: 0x...01F4   (should be WETH, looks like a uint shifted into address slot)
royaltyRate: 1773653524   (way too high for bps, likely an address fragment)
royaltyBeneficiary: 0x4200...0006  (this is WETH, not the creator)

Impact

  • WriterTradingStats component silently catches the revert → shows "–" for earnings
  • ClaimRoyalties component likely also fails → no claim button appears
  • Writers can never see or claim royalties

Investigation needed

  1. Verify the actual tokenBond struct layout in the deployed MCV2_Bond contract (may need to check Etherscan ABI or Mint Club V2 source)
  2. Verify if getRoyaltyInfo exists on this contract version or if the function name is different
  3. Update mcv2BondAbi in lib/price.ts to match the actual contract
  4. Verify StoryFactory sets royalty beneficiary to the story creator during createStoryline

Files likely affected

  • lib/price.tsmcv2BondAbi definition
  • src/components/WriterTradingStats.tsx — royalty display
  • src/components/ClaimRoyalties.tsx — royalty claiming
  • Possibly lib/contracts/abi.ts — StoryFactory ABI if royalty params need to be set at creation

Reproduction

# This reverts:
cast call 0x5dfA75b0185efBaEF286E80B847ce84ff8a62C2d \
  "getRoyaltyInfo(address)" \
  0x14262a4576b53d94ef1333b5604e7c99862c05ce \
  --rpc-url https://sepolia.base.org

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