Skip to content

prevrandao

function prevrandao(bytes32) external;
function prevrandao(uint256) external;

Sets block.prevrandao.

If used with an EVM version previous to the Paris hard fork, it will revert. In that case, use vm.difficulty instead.

vm.prevrandao(bytes32(uint256(42)));
emit log_uint(block.prevrandao); // 42