> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.getfoundry.sh/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

## `fee`

### Signature

```solidity
function fee(uint256 baseFee) external;
```

### Description

Sets `block.basefee` to the specified value.

### Parameters

| Parameter | Type      | Description                     |
|-----------|-----------|---------------------------------|
| `baseFee` | `uint256` | The new base fee to set (in wei)|

### Examples

```solidity [test/Fee.t.sol]
function testFee() public {
    vm.fee(25 gwei);
    assertEq(block.basefee, 25 gwei);
}
```

### Related Cheatcodes

* [`txGasPrice`](/reference/cheatcodes/tx-gas-price) - Sets the transaction gas price
* [`warp`](/reference/cheatcodes/warp) - Sets `block.timestamp`
* [`roll`](/reference/cheatcodes/roll) - Sets `block.number`
