fix: claim rewards pipeline uses the rollup fee asset, not the staking asset#106
Merged
Conversation
…aking asset Sequencer rewards are paid in Rollup.getFeeAsset() (RewardLib.claimSequencerRewards does feeAsset.safeTransfer). On mainnet feeAsset == stakingAsset so the pipeline happened to work; on testnet they differ, so Split.distribute() was called with the staking asset, distributed a zero balance, and left the actual fee-asset rewards stranded on the split contract. Adds useFeeAssetTokenDetails (reads getFeeAsset from the canonical rollup) and swaps it into every reward claim/read path: claim buttons and modals, aggregated staking data, split reward totals, and the operator page.
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.
Problem
Sequencer rewards are paid in the rollup's fee asset —
RewardLib.claimSequencerRewardsdoesrollupStore.config.feeAsset.safeTransfer(_sequencer, amount). The dashboard's entire claim pipeline instead usedStakingRegistry.STAKING_ASSETas the reward token.On mainnet
feeAsset == stakingAsset, so this happened to work. On testnet they are different tokens ("FeeJuice" vs "Staking"), which breaks the flow:claimSequencerRewardsmoves FEE onto the split contract ✅Split.distribute(..., STK, ...)distributes the split's STK balance, which is 0 — the tx succeeds but distributes nothingExample stuck claim on Sepolia:
0x3b5cc63dab45e00a249fb4f4af35de20f21a563a1e5dfc3e05425bb4f6ce2a05— 5.16 FEE stranded on split0x75592d3372aE11212e1dd47797B84797DE6Ee98C.Fix
getFeeAssetto the frontend Rollup ABIuseFeeAssetTokenDetails()hook — resolves the reward token from the canonical rollup'sgetFeeAsset()useStakingAssetTokenDetails()in every reward claim/read path:ClaimDelegationRewardsButton,ClaimAllDelegationRewardsButton,ClaimAllRewardsModal,ClaimDelegationRewardsModal,ClaimSelfStakeRewardsModal,useAggregatedStakingData,useMultipleStakeWithProviderRewards,useTotalSplitRewards,OperatorPageStaking/deposit flows are untouched — they correctly keep using the staking asset.
Notes