The openBox
function uses randomValue
generated from msg.sender and block.timestamp, which can be predictable and vulnerable to exploitation.
The openBox
function attempts to generate a random number to determine the reward a user receives.
The function is designed to randomly select a reward for the user when they open a mystery box.
The random number is derived from block.timestamp
and msg.sender
. block.timestamp
can be influenced slightly by miners, allowing them to manipulate the outcome. msg.sender
is known to the user, enabling them to repeatedly call the function from different addresses to achieve a desired result.
An attacker could predict or manipulate the random number generated by the contract, allowing them to consistently obtain valuable rewards.This undermines the fairness of the reward distribution.
Manual Review
Using a secure method for random number generation such as Chainlink VRF, which provides provably fair and tamper-proof randomness. This ensures that the random number generation is resistant to manipulation, maintaining the integrity and fairness of the reward system.
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.