The removeSplitter function in the LSTRewardsSplitterController contract is designed to remove a splitter associated with an account, distribute any remaining rewards, and clean up the contract state.
The vulnerability lies in the function's failure to properly handle the case where the splitter's balance is less than its recorded principal deposits. This can lead to a situation where funds are locked in the splitter contract.
Funds Lock-up: If the splitter's balance is less than its principalDeposits, the withdraw call will revert, preventing the splitter from being removed and potentially locking funds.
Inconsistent State: The contract could end up in a state where a splitter can't be removed, leading to accumulation of "dead" splitters.
Denial of Service: It could prevent the removal of splitters that have experienced losses, hampering contract management.
A splitter is created with 100 tokens as principal deposits.
Due to some error or external factor, 10 tokens are lost or stuck (balance becomes 90).
The owner tries to remove the splitter.
The removeSplitter function checks the balance (90) and principalDeposits (100).
It attempts to withdraw 90 tokens, but this fails because it's less than the principalDeposits.
The splitter cannot be removed, and the remaining 90 tokens are locked.
To address this issue, we need to handle cases where the balance might be less than principalDeposits, and ensure we can always remove a splitter.
This fix ensures that the splitter can always be removed, even in scenarios where there's been a loss of funds. It withdraws whatever balance is available, updates the contract state, and emits an event with relevant information for off-chain tracking.
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.