GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

getRandomness needs to use previous block's hash not this block #10

Closed tomosaigon closed 3 years ago

tomosaigon commented 3 years ago

This code: keccak256(abi.encodePacked(block.timestamp, msg.sender, blockhash(block.number))

will call blockhash(block.number) where block.number is the currently executing block so blockhash() will return 0. We need to call:

blockhash(block.number-1)

tomosaigon commented 3 years ago

I see this is fixed.