When checking if totalPercentage is correct in the _distribute function, the value is compared with a hardcoded value 10000. Assuming this value is the same as BASIS_POINTS, if the BASIS_POINTS and COMMISSION_FEE gets updated in the future, two things can happen:
All _distribute executions get reverted due to an underflow error.
Only a tenth of the rewards get distributed to the winners due to incorrect totalPercentage check.
Underflow Scenario
This can happen if BASIS_POINTS is set to a number such as 100_000 for higher precision and COMMISSION_FEE is set to 11000. _distribute will revert every time due to an underflow error at 10000 - COMMISSION_FEE. The calculated value can be -1000. Winners will not be able to get rewards.
Small rewards Scenario
For higher precision, let's say the BASIS_POINTS and COMMISSION_FEE gets updated to the following values:
COMMISSION_FEE = 5000
totalAmount = 100 // for simplicity
If the totalPercentage check passes where (10000 - COMMISSION_FEE) = 5000`, the winners will only a tenth of the expected rewards:
The rest of the rewards will get sent to the STADIUM_ADDRESS.
Winners do not get the full amount or no rewards in the worst case scenario.
Manual Analysis
Use the BASIS_POINTS constant instead of a hardcoded value.
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.