The smart contract uses block.timestamp
and block.difficulty
as sources of randomness, which are manipulatable by miners to some extent.
The selectWinner function uses keccak256(abi.encodePacked(msg.sender, block.timestamp, block.difficulty))
to determine the winner and the rarity of the NFT. Miners could potentially manipulate block.timestamp
and block.difficulty
to favor a particular outcome.
An attacker could gain an unfair advantage in the raffle, undermining the integrity of the game.
Manual Code Review
Use a more secure source of randomness like Chainlink VRF
Root cause: bad RNG Impact: manipulate winner
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.