The function openBox uses deterministic values for generating the variable randomValue which determines the reward for the user so the output can be determined in advance.
The function openBoxdetermines the reward based on the output of the keccak256function:
The output depends on the timestamp of the block and on the address of the sender. Since the block timestamp can be predicted in advance (block times are 12 seconds on the Ethereum blockchain), the randomValue variable can be predicted.
A validator can include their own transaction in a block in which the predicted randomValueis 95 or greater (or even 99 for the highest reward). Even an ordinary user can calculate the block in which their odds are highest and submit the transaction right on time with a high gas fee to stimulate the validator to include their transaction in the desired block. This unintended behavior can break the desired random game mechanics.
Manual inspection.
It is recommended to use Chainlink VRF (Verifiable Random Function) for generating a random number.
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.