Description: The SpookySwap
contract uses the random
logic to generate a random number. The random
logic uses the block.timestamp
and other block
data as a seed for the random number. However, the block.timestamp
and other block
data can be manipulated by the miner. The miner can pick this parameters to the desired value and predict the random number.
Line of code: TrickOrTreat.sol#L57
The miner can predict the random number and manipulate the game.
Manual code analysis
Foundry for testing
Consider using the Chainlink VRF to generate a random number.
It's written in the README: "We're aware of the pseudorandom nature of the current implementation. This will be replaced with Chainlink VRF in later builds." This is a known issue.
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.