> **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.

## `deal`

### Signature

```solidity
function deal(address account, uint256 newBalance) external;
```

### Description

Sets the ETH balance of an address `account` to `newBalance`.

### Parameters

| Parameter    | Type      | Description                              |
|--------------|-----------|------------------------------------------|
| `account`    | `address` | The account whose balance will be set   |
| `newBalance` | `uint256` | The new ETH balance (in wei)            |

### Examples

```solidity [test/Deal.t.sol]
function testDeal() public {
    address alice = makeAddr("alice");
    vm.deal(alice, 1 ether);
    assertEq(alice.balance, 1 ether);
}
```

#### ERC20 Token Deals

For ERC20 tokens, use the `deal` function from `StdCheats.sol` which provides additional functionality:

```solidity [test/DealERC20.t.sol]
import {Test} from "forge-std/Test.sol";

contract DealERC20Test is Test {
    function testDealERC20() public {
        address alice = makeAddr("alice");
        deal(address(DAI), alice, 1 ether);
        assertEq(DAI.balanceOf(alice), 1 ether);
    }
}
```

### Gotchas

:::note
The Forge Standard Library version of `deal` for ERC20 tokens works by directly manipulating storage slots. It may not work correctly for tokens with non-standard storage layouts or tokens that have balance hooks (like rebasing tokens).
:::

### Related Cheatcodes

* [`etch`](/reference/cheatcodes/etch) - Sets the bytecode of an address
* [`prank`](/reference/cheatcodes/prank) - Sets `msg.sender` for the next call

### See Also

* [`deal`](/reference/forge-std/deal) - Forge Std ERC20 deal function
* [`hoax`](/reference/forge-std/hoax) - Combines prank and deal
* [`startHoax`](/reference/forge-std/startHoax) - Combines startPrank and deal
