The setEggFindThreshold
function allows the owner to set a threshold value up to 100. However, the random value generated by the game logic ranges from 0 to 99 (mod 100), meaning 100 can never be hit. This leads to a subtle logic flaw where an owner may believe the threshold is valid and accurate, but it's actually off by one.
random number between generator logic is as followed:
and threshold check currently permist 100
:
this introduces an off-by-one logic error:
A threshold of 50 does not give a 50% win chance but ~49.5%
A threshold of 100 results in a 100% win chance, not the expected 99%.
This misalignment leads to inaccurate game logic, potentially undermining fairness or gameplay balance.
Even if the owner is trusted, this results in misleading configuration and unintentional behavior.
static analysis
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.