People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
block.difficulty with block.prevrandao. Although, the opcode is still the same, the values have different meanings now.prevrandao is meant to be a source of randomness on chain that is created using decentralized information. This is generated with the following steps for each validator:
prevrandao from the future. According to the EIP-4399 specification, this should be 4 epochs into the future. The reason for this is that we can limit the influence of an attacker by forcing them to guess earlier on. prevrandao opcode returns a favorable value. To fix this problem, enforce that the transaction happens on a particular block in the future.