Convert curator reward claims to pull credits#61
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, push a new commit or reopen this pull request to trigger a review.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR implements curator reward claim credits for StreamCuratorsPool (P0-PAY-005): curator reward claims now validate Merkle proofs and record withdrawable credits instead of pushing ETH; the contract tracks per-curator credit balances and aggregate owed state; emergency withdrawal is bounded to surplus above curator owed amounts. Tests and documentation updated to reflect and validate the new semantics. ChangesCurator Reward Claim Credits (P0-PAY-005)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@claude please review this PR for security and protocol-accounting correctness. Focus areas:
|
|
@coderabbitai review CI is green on latest head |
|
✅ Action performedFull review finished. |
|
Merge-readiness note for latest head
Proceeding under the same stale-status exception pattern used for prior PRs in this autonomous run. |
Summary
Converts
StreamCuratorsPool.claimRewardsfrom a synchronous ETH push payout into ADR 0003-style curator pull credits.The claim path now validates the Merkle proof, checks local curator-pool surplus before consuming the claim, records
curatorCredits[rewardAddress], incrementstotalCuratorOwed, and emits a curator-credit event. Reward recipients are no longer called during claim consumption, so reverting reward addresses cannot block valid claims.This PR also adds guarded curator-credit withdrawals, local owed/surplus views, surplus-bounded curator-pool emergency withdrawal, focused tests, and roadmap/status traceability.
Closes #29.
Roadmap
StreamDropsfixed-price curator reserves or auction curator credits intoStreamCuratorsPool, randomizer reserves, and the remaining [P0-PAY-001] Add pull-payment accounting #25/[P0-PAY-002] Add credit ledger storage and total-owed views #26/[P0-PAY-006] Add withdrawal functions and failed-withdrawal behavior #30/[P0-PAY-007] Bound emergency withdrawals by surplus #31/[P0-PAY-008] Bound emergency withdrawals and prove owed-balance invariants #8 work outside this local curator-pool boundary.Security And Maturity
Review Routing
Validation
Local commands run:
make checkor platform equivalent passed.Impact
StreamCuratorsPool.t.solcoverage for valid claims, duplicate/invalid/unfunded claims, delegation, rejecting reward addresses, failed withdrawal preservation, withdrawal reentrancy,abi.encodereward leaves, local owed/surplus accounting, and forced ETH surplus.StreamCuratorsPoolsurplus before claim consumption. Shared ledger and reserve movement from other contracts into the curator pool remain future work and are intentionally not claimed here.Reviewer Notes
Please focus on the local accounting boundary: this PR intentionally prevents unfunded curator credits instead of trying to move reserves across contracts in the same change. It also changes reward Merkle leaf hashing from packed encoding to
abi.encode(rewardAddress, collectionID, amount)as a pre-beta target-state safety fix.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation