The function update in Staking.sol has an if statement which is useless, and makes now sense to have it.
Update checks first if _balance is greater than balance
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Staking.sol#L65
then it does the difference between those two variables
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Staking.sol#L66
and then it checks again with another if statement if the value of the difference is greater than 0
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Staking.sol#L67
but this is mostly useless, since if the first statement is true, and _balance is greater than balance it means that the difference will always be greater than 0.
Low impact, don't use that if statement since it doesn't do anything
Manual review
Delete the if statement stated
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.