The setRewardsReceiver
function contains an incorrect revert error when validating the caller. Specifically, when rewardsReceiver
is set to the zero address and the caller is not the contract owner, the function reverts with the OnlyRewardsReceiver
error instead of the intended OnlyOwner
error.
Issue: The function checks whether the rewardsReceiver
is the zero address and if the caller is not the contract owner. If both conditions are met, the function reverts with an incorrect error: OnlyRewardsReceiver
. This creates confusion as the caller expects a revert with OnlyOwner
, indicating that only the owner should be able to set the receiver in such a case.
It may cause confusion during debugging or when trying to understand why certain conditions are failing, especially for users or developers interacting with the contract.
Manual review
Update the conditional check to revert with the correct OnlyOwner
error message when the caller is not the owner and the rewardsReceiver
is the zero address.
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.