The LSTRewardsSplitter contract's performUpkeep function is responsible for distributing earned rewards. It calculates the rewards as the difference between the current LST balance and the recorded principalDeposits.
The function has a flaw in its logic for handling cases where the current LST balance is less than principalDeposits. Instead of reverting the transaction, it attempts to adjust principalDeposits downwards. This adjustment is incorrect and could lead to an inconsistent state where principalDeposits no longer accurately reflects the actual principal deposited by users.
Inconsistent State: The incorrect adjustment of principalDeposits can lead to a mismatch between the contract's internal accounting and the actual principal.
Incorrect Reward Distribution: Future reward calculations will be based on the incorrectly adjusted principalDeposits, potentially leading to overstated rewards and an unfair distribution.
Loss of Funds: In the long run, this inconsistency could result in a situation where users might not be able to withdraw their full deposit, as the contract's record of their principal is lower than the actual amount.
A user deposits 100 LST tokens.
Due to an external factor (e.g., a vulnerability in the LST token or slashing), 50 tokens are lost from the contract.
The contract now has 50 tokens, but principalDeposits is still 100.
When performUpkeep is called, instead of reverting, it adjusts principalDeposits to 50.
Future reward calculations will be based on this lower principal, potentially leading to the distribution of user funds as "rewards."
Revert the transaction when the current balance is less than principalDeposits. This ensures that the contract maintains an accurate record of the principal and prevents incorrect reward distribution.
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.