The removeSplitter
function in the LSTRewardsSplitterController
fails to account for balance changes after splitting rewards, attempting to withdraw more tokens than available and causing the transaction to remove a splitter to always revert.
https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/lstRewardsSplitter/LSTRewardsSplitterController.sol#L130
In the removeSplitter function:
The function checks the initial balance and compares it to principalDeposits.
If they differ, it calls splitRewards() on the LSTRewardsSplitter contract.
The splitRewards() function distributes rewards and updates principalDeposits to the new balance.
removeSplitter then attempts to withdraw the initial balance, which now exceeds the actual balance after reward distribution.
Permanent inability to remove splitters that have accumulated rewards.
Manual review
Update the removeSplitter function to re-check the balance after splitting rewards:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.