?
contract Random { uint nonce = 0; function random() public returns(uint) { nonce += 1; return uint(keccak256(abi.encodePacked(nonce))); } }
How could that be taken advantage of?
Because it's pseudo-random as Michael explained. Thus not truly random numbers. I believe this can only be done off chain in a truly secure way. In turn it causes vulnerabilities. In the ethernaut smart contact hacking tutorial this was one of the vulnerabilities too I believe.
Обсуждают сегодня