The setEggFindThreshold
function allows the contract owner to adjust the probability of finding an egg. However, it does not prevent the owner from setting this threshold to 0, which would make it impossible for any player to find an egg.
The setEggFindThreshold
function updates the eggFindThreshold
state variable, which is used in the searchForEgg
function to determine if a player finds an egg.
The setEggFindThreshold
function only checks if newThreshold
is less than or equal to 100 but lacks a check to ensure it's greater than 0. If the owner sets eggFindThreshold
to 0, the condition random < eggFindThreshold
in the searchForEgg
function can never be true, as the pseudo-random number random
is calculated as ... % 100
, resulting in a value between 0 and 99 inclusive.
Setting the eggFindThreshold
to 0 makes it impossible for players to find eggs by calling searchForEgg
. This breaks the core gameplay loop and renders the game unplayable, potentially violating players' expectations of a fair game where there is always at least a small chance of success.
Manual Review
Modify the setEggFindThreshold
function to ensure the newThreshold
is strictly greater than 0.
Owner is trusted and is not expected to interact in ways that would compromise security
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.