Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cheat_block_hash

Changes the block hash for the given block number and contract address.

  • contract_address - The contract address to which the cheat applies.
  • block_number - Block number to be modified.
  • block_hash - felt252 representing the new block hash.
  • span - instance of CheatSpan specifying the number of syscalls with the cheat

Fully qualified path: snforge_std::cheatcodes::block_hash::cheat_block_hash

pub fn cheat_block_hash(
    contract_address: ContractAddress, block_number: u64, block_hash: felt252, span: CheatSpan,
)