> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Check Execution Mode \[erc7821.supportsExecutionMode]

Checks if a contract supports an [ERC-7821](https://eips.ethereum.org/EIPS/eip-7821) execution mode. Results are cached per client, address, and mode.

## Usage

This example checks if a contract supports an [ERC-7821](https://eips.ethereum.org/EIPS/eip-7821) execution mode.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const supported = await client.erc7821.supportsExecutionMode({
  address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
})
// @log: true
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, erc7821Actions, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
}).extend(erc7821Actions())
```
:::

### Standalone Action

Call `Actions.erc7821.supportsExecutionMode` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem'
import { client } from './viem.config'

const supported = await Actions.erc7821.supportsExecutionMode(client, {
  address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
})
// @log: true
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
import { Client, http } from 'viem'
import { mainnet } from 'viem/chains'

export const client = Client.create({
  chain: mainnet,
  transport: http(),
})
```
:::

## Return Value

`boolean`

Whether the contract supports the execution mode. Returns `false` when the contract does not implement `supportsExecutionMode` (or the call fails).

## Parameters

### address

* **Type:** `Address`

The address of the contract to check.

```ts twoslash
import { Actions } from 'viem'
// [!include ~/snippets/docs/reference-client.ts:setup]
// ---cut---
const supported = await Actions.erc7821.supportsExecutionMode(client, {
  address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', // [!code focus]
})
```

### mode

* **Type:** `'default' | 'opData' | 'batchOfBatches' | Hex`
* **Default:** `'default'`

The execution mode to check.
Use `'default'`, `'opData'`, `'batchOfBatches'`, or a raw `bytes32` mode value.

```ts twoslash
import { Actions } from 'viem'
// [!include ~/snippets/docs/reference-client.ts:setup]
// ---cut---
const supported = await Actions.erc7821.supportsExecutionMode(client, {
  address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  mode: 'opData', // [!code focus]
})
```
