The code contains a vulnerability in the comparison logic for the random
value and the eggFindThreshold
. Currently, the condition checks if random < eggFindThreshold
, which results in an incorrect threshold comparison. If random
equals the value of eggFindThreshold
, the player does not win, even though they should. The comparison should instead check if random <= eggFindThreshold
to ensure that the percentage chance works as intended.
In the current code, the random
value is compared with the eggFindThreshold
to determine whether the player successfully finds an egg. The issue arises because the condition uses random < eggFindThreshold
, which excludes the possibility of winning when random
is equal to eggFindThreshold
. For example, if the eggFindThreshold
is set to 20, a random
value of 20 will incorrectly fail the condition, even though it should result in a successful egg finding.
The winning percentage is less than it should be.
Foundry.
Manual Review.
Fix the comparison logic:
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.