The function notifyRewardAmount()
does not check if amount > 0
before executing updateReward(address(0))
. This results in unnecessary function calls and wasted gas when amount == 0
, as there is no reason to proceed with reward calculations in such cases.
amount > 0
ValidationThe function does not check if amount == 0
before calling updateReward(address(0))
.
If amount == 0
, updateReward()
still executes, consuming unnecessary gas.
Since notifyRewardAmount()
has no effect when amount == 0
, the function should exit early to prevent gas waste.
Unnecessary Gas Consumption:
Calling updateReward(address(0))
when amount == 0
wastes gas.
The redundant amount > periodState.emission
check increases execution costs.
The function executes logic that has no impact when amount == 0
.
This issue is more severe in high-frequency reward distributions (e.g., staking, farming).
Manual Review
Add amount == 0 validation check in the start of the function.
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.