fix: add collectRewards to fix creator reward claiming - #127
Open
openclawdwang-ship-it wants to merge 2 commits into
Open
fix: add collectRewards to fix creator reward claiming#127openclawdwang-ship-it wants to merge 2 commits into
openclawdwang-ship-it wants to merge 2 commits into
Conversation
…ing (clanker-devco#126) The 80/20 creator reward split appears broken because the SDK only wraps ClankerFeeLocker.claim() but never calls ClankerLocker.collectRewards(), which is required to first collect accrued Uniswap V4 fees and distribute them to the FeeLocker according to the reward bps configuration. Without calling collectRewards first, availableFees returns 0 for all recipients, making creators appear "ineligible" even when fees have accrued. Changes: - Add collectRewards() — calls ClankerLocker.collectRewards(token) to trigger fee collection from Uniswap V4 and distribution to FeeLocker - Add collectAndClaimRewards() — recommended method that does both steps in sequence (collect then claim), preventing the common 0-balance issue - Add diagnoseRewards() — returns on-chain reward config and claimable balances for each recipient, useful for debugging eligibility issues - Update collectRewards example to demonstrate the full flow - Add tests for collectRewards, getTokenRewards, and diagnoseRewards Closes clanker-devco#126
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hey @jackdishman — friendly ping on this PR. It adds the missing |
|
Hey @jackdishman — just bumping this again. PR adds the missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #126
Creators report getting 0% of their 80/20 reward split because
availableFeesreturns 0. Root cause: the SDK only wrapsClankerFeeLocker.claim()but never exposesClankerLocker.collectRewards(), which must be called first to collect accrued Uniswap V4 fees and distribute them to the FeeLocker.Without calling
collectRewards, the FeeLocker has no balance for any recipient — making creators appear "ineligible" even when trading fees have accrued in the pool.Changes
collectRewards()— callsClankerLocker.collectRewards(token)to trigger fee collection from Uniswap V4 and split fees into FeeLocker by bpscollectAndClaimRewards()— recommended method: collect then claim in sequence, prevents the 0-balance issuediagnoseRewards()— returns on-chain reward config + claimable balances per recipient, useful for debugging eligibilitycollectRewardsexample to show full collect → claim flowHow this fixes the issue
Before:
After: