The function updateUserBoost contains an unnecessary check for paused() even though the function is already gated by the whenNotPaused modifier. This results in redundant code execution, which is inefficient and can be removed without affecting security.
The updateUserBoost function contains the following check:
However, this function is already protected by the whenNotPaused modifier:
Since whenNotPaused ensures the function cannot be executed when the contract is paused, the explicit if (paused()) revert EmergencyPaused(); check is redundant.
Unnecessary gas cost: The redundant check increases gas usage for every call to updateUserBoost.
Code clutter: Including unnecessary conditions makes the codebase less clean and harder to maintain.
Manual code review
Remove the redundant if (paused()) revert EmergencyPaused(); check since whenNotPaused already ensures that the function cannot be executed when the contract is paused.
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.