# setBlockhash

Description: setBlockhash cheatcode documentation

Note: This document was authored using MDX

  Source: https://github.com/NomicFoundation/hardhat-website/tree/main/src/content/docs/docs/reference/cheatcodes/Environment/set-blockhash.mdx

### Signature

```solidity
function setBlockhash(uint256 blockNumber, bytes32 blockHash) external;
```

### Description

Set blockhash for the current block.
It only sets the blockhash for blocks where `block.number - 256 <= number < block.number`.
