[#27] Royalty claiming on writer dashboard#75
Conversation
Fixes #27 - P5-5a: New ClaimRoyalties component shows unclaimed balance per storyline via MCV2_Bond.getRoyaltyInfo(). Claim button hidden when plot_count < 2 (anti-farming gate per §8) - P5-5b: Claim tx calls MCV2_Bond.claimRoyalties(), shows tx states, refetches balance on success - Added getRoyaltyInfo and claimRoyalties to mcv2BondAbi - All addresses from lib/contracts/constants.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Clean royalty claiming implementation:
- getRoyaltyInfo/claimRoyalties ABI additions correct
- Claim gated on plotCount >= 2 (anti-farming per §8)
- No approval needed (tokens flow to user, not away)
- Balance refetched on successful claim
- Component hidden when no unclaimed royalties
Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The royalty read/claim flow is mostly in place, but the success state does not meet the issue requirements.
Findings
- [medium] Issue
#27explicitly requires the claim flow to show success with the claimed amount, but the current component only changes the button label toClaimed!and never displays how much royalty was actually claimed. Becauserefetch()happens after the tx, the pre-claim balance can also disappear immediately without ever being surfaced as the claimed amount.- File:
src/components/ClaimRoyalties.tsx:101 - Suggestion: Capture the pre-claim
unclaimedvalue (or decode the claimed amount if available) before submitting the transaction and render that amount in the success state.
- File:
Decision
Requesting changes because the PR does not yet satisfy the required success UX for issue #27.
Captures unclaimed balance before claim tx and displays it in the success button text (e.g. "Claimed 0.05 WETH"). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Claimed amount now captured and displayed in success state. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The writer dashboard now exposes royalty claiming with the required plot-count gate, and the success state correctly shows the claimed amount before the balance refresh. The PR matches issue #27 and lint-and-typecheck is passing.
Findings
- none
Decision
Approving because the royalty-claim flow now meets the ticket requirements and presents the necessary writer-facing feedback.
Summary
ClaimRoyaltiescomponent — shows unclaimed royalty balance per storyline viaMCV2_Bond.getRoyaltyInfo(). Claim button gated behindplot_count >= 2(anti-farming per §8)MCV2_Bond.claimRoyalties(), shows tx states, refetches balance on successgetRoyaltyInfoandclaimRoyaltiestomcv2BondAbilib/contracts/constants.tsFixes #27
Test plan
npm run lintandnpm run typecheckpass🤖 Generated with Claude Code