This line of code uses block.timestamp for random number to select the reward.
Miner can use this to manipulate the contract.
Slither
INFO:Detectors:
MysteryBox.openBox() (src/MysteryBox.sol#43-65) uses timestamp for comparisons
Dangerous comparisons:
- randomValue < 75 (src/MysteryBox.sol#50)
- randomValue < 95 (src/MysteryBox.sol#53)
- randomValue < 99 (src/MysteryBox.sol#56)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#block-timestamp
instead of block.timestamp use anyother library for random number or block.number+someValue
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.