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

## `resetNonce`

### Signature

```solidity
function resetNonce(address account) external;
```

### Description

Resets the nonce of `account` to the value a new account of its kind starts with: `0` for an EOA and `1` for a contract ([EIP-161](https://eips.ethereum.org/EIPS/eip-161)).

An account without code is an EOA. An account whose code is an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) delegation designator is also an EOA, so it resets to `0`. Any other account with code resets to `1`.

Unlike [`setNonce`](/reference/cheatcodes/set-nonce), `resetNonce` can lower the nonce.

### Parameters

| Parameter | Type      | Description                    |
|-----------|-----------|--------------------------------|
| `account` | `address` | The account to reset the nonce of |

### Examples

```solidity [test/ResetNonce.t.sol]
// [!include ~/snippets/projects/nonces/test/ResetNonce.t.sol:reset-nonce]
```

An EOA with an EIP-7702 delegation resets to `0`:

```solidity [test/ResetNonce.t.sol]
// [!include ~/snippets/projects/nonces/test/ResetNonce.t.sol:reset-nonce-delegated]
```

### Gotchas

* The reset is kept even if the call that made it reverts later, for example inside a `try` call that fails.
* Lowering a contract's nonce makes its next `CREATE` reuse an address it may already have deployed to.

### Related Cheatcodes

* [`setNonce`](/reference/cheatcodes/set-nonce) - Sets the nonce of an account, only upward
* [`setNonceUnsafe`](/reference/cheatcodes/set-nonce-unsafe) - Sets the nonce of an account to any value
* [`getNonce`](/reference/cheatcodes/get-nonce) - Gets the nonce of an account
