Pseudo Random Number Generators (PRNG) are used to generate Random Numbers in smart contract. How ever certain source used in this generators can be influenced and Predicted making them "weak."
function addReward(string memory _name, uint256 _value) public {
require(msg.sender == owner, "Only owner can add rewards");
rewardPool.push(Reward(_name, _value));
}
An attacker who can control the odering of transacton in the his minig block, can call the openBlock()
functon in his own transcation and mine. and when the transaction is reordered within the block, with a specific blockhash (block.blockhas(1000) that ensures a desired outcomewhen 10% is calculated.
By doing this the miner "wins" the game, as He can predict the random value to be predictable.
aderyn, slither and chatgpt
The use of chainlink VRF will be a better and more secure option as it provides cryptographical randomness.
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.