You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6bbd9eb
Browse filesBrowse the repository at this point in the historyBrowse files
Fix: show and claim distributed rewards for delegators who stake from a wallet (#126)
* Fix: show distributed rewards to delegators who stake from a wallet
The dashboard reads the rewards warehouse address from the first delegation
that has a split contract, but it only looked at token-vault delegations. A
delegator who stakes directly from a wallet has none, so the address stayed
undefined, the warehouse balance was never read, and already distributed
rewards showed as zero.
Fall back to an ERC20 delegation's split contract. Every split points at the
same warehouse for a given token, so either source resolves the same address.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Let wallet delegators claim the warehouse balance, not just see it
The previous commit made the distributed rewards balance visible to a
delegator who stakes from a wallet. The claim path stayed shut.
"Claim All Rewards" resolves the warehouse address from token-vault
delegations only. For a wallet-only delegator that address is undefined, so
the withdraw step is skipped while the cart still opens. The user sees the
amount itemised, clicks, and gets an empty cart with no error.
The per-delegation path does not cover it either. A fully distributed
position has no rollup or split balance left, so the row reports zero
rewards and its claim button is disabled.
Apply the same fallback in the claim-all modal and pass the wallet
delegations in from the overview. The withdraw leg is a per-user, per-token
call, so either delegation kind resolves the same warehouse address.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Resolve the warehouse split in one shared helper
The rule for picking a split contract to read the warehouse address from was
written out at each call site, and the copies had drifted: two of them looked
at token-vault delegations only, which is what hid the balance from wallet
delegators in the first place.
Move the rule into `resolveWarehouseSplit` and call it from the three sites
that choose from a list. Each site keeps its own preference order, so
behaviour is unchanged for a delegator who holds token-vault delegations.
The helper also scans for the first entry that carries a split contract,
rather than reading index zero. An entry without one no longer hides the
warehouse from the entries behind it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments