Skip to content

fix: add collectRewards to fix creator reward claiming - #127

Open
openclawdwang-ship-it wants to merge 2 commits into
clanker-devco:mainfrom
openclawdwang-ship-it:fix/reward-claiming-126
Open

fix: add collectRewards to fix creator reward claiming#127
openclawdwang-ship-it wants to merge 2 commits into
clanker-devco:mainfrom
openclawdwang-ship-it:fix/reward-claiming-126

Conversation

@openclawdwang-ship-it

Copy link
Copy Markdown

Summary

Fixes #126

Creators report getting 0% of their 80/20 reward split because availableFees returns 0. Root cause: the SDK only wraps ClankerFeeLocker.claim() but never exposes ClankerLocker.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() — calls ClankerLocker.collectRewards(token) to trigger fee collection from Uniswap V4 and split fees into FeeLocker by bps
  • collectAndClaimRewards() — recommended method: collect then claim in sequence, prevents the 0-balance issue
  • diagnoseRewards() — returns on-chain reward config + claimable balances per recipient, useful for debugging eligibility
  • Updated collectRewards example to show full collect → claim flow
  • Added tests for new methods

How this fixes the issue

Before:

claimRewards() → FeeLocker.claim() → "NoFeesToClaim" / 0 balance

After:

collectAndClaimRewards()
  → ClankerLocker.collectRewards() → distributes fees to FeeLocker
  → FeeLocker.claim() → creator gets their 80% share

…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>
@cwanglab

cwanglab commented Mar 3, 2026

Copy link
Copy Markdown

Hey @jackdishman — friendly ping on this PR. It adds the missing collectRewards method to fix creator reward claiming (#126). Tests are passing. Let me know if you have any questions or want changes.

@cwanglab

cwanglab commented Mar 4, 2026

Copy link
Copy Markdown

Hey @jackdishman — just bumping this again. PR adds the missing collectRewards method to fix #126. Tests passing, ready for review whenever you get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creator rewards claim broken — 80% creator share not claimable, all fees go to protocol

2 participants