The checkUpkeep function in the LSTRewardsSplitter contract contains a logical error that could lead to incorrect triggering of the performUpkeep function. The function returns true under conditions that do not align with the intended behavior.
The checkUpkeep function is designed to determine whether the performUpkeep function should be called to split new rewards. However, its current implementation contains a logical flaw in its return condition:
This condition will return true in two scenarios:
When newRewards is negative
When newRewards is greater than or equal to controller.rewardThreshold()
The first condition (newRewards < 0) is particularly problematic as it suggests that upkeep should be performed when the contract has fewer tokens than its recorded principal deposits. This scenario should typically be handled as an error state rather than triggering a reward distribution.
checkUpkeep function returns true when it should return false
Manual review
Modify the checkUpkeep function to only return true when there are actual rewards to distribute.
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.