_withdrawRewards function in the OperatorVault contractIn the _withdrawRewards function, the calculation rewards - balance result in an underflow if the balance is greater than rewards. This is because subtracting a larger number (balance) from a smaller number (rewards).
The transaction will revert due to an underflow caused by the subtraction rewards - balance.
Example: If rewards = 100 and balance = 150, the subtraction 100 - 150 results in -50, which is invalid for uint256.
The underflow will revert the entire transaction, preventing any further operations from being executed. It could disrupt the correct distribution of rewards and block functionality for other users.
manual review
Before performing the subtraction, add a check to ensure that balance is not greater than rewards:
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.