# deal

Description: deal 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/deal.mdx

{/* This document contains content copied/adapted from the Foundry Book (MIT licensed). See LICENSE in the parent directory. */}

### Signature

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

### Description

Sets the balance of an address `who` to `newBalance`.

If the alternative signature of `deal` is used (defined in `StdCheats.sol`), then we can additionally specify ERC20 token address, as well as an option to update `totalSupply`.

### Examples

```solidity
address alice = makeAddr("alice");
emit log_address(alice);
vm.deal(alice, 1 ether);
log_uint256(alice.balance); // 1000000000000000000
```

```solidity
address alice = makeAddr("alice");
emit log_address(alice);
deal(address(DAI), alice, 1 ether); // import StdUtils.sol first
log_uint256(address(DAI).balanceOf(alice)); // 1000000000000000000
```

### SEE ALSO

Forge Standard Library

[`deal`](https://getfoundry.sh/reference/forge-std/deal), [`hoax`](https://getfoundry.sh/reference/forge-std/hoax), [`startHoax`](https://getfoundry.sh/reference/forge-std/startHoax)
