# Execute.encodeData

Encodes calls for the ERC-7821 `execute` function.

## Imports

:::code-group
```ts [Named]
import { Execute } from 'ox/erc7821'
```

```ts [Entrypoint]
import * as Execute from 'ox/erc7821/Execute'
```
:::

## Examples

```ts twoslash
import { Execute } from 'ox/erc7821'

const data = Execute.encodeData([
  {
    data: '0xcafebabe',
    to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
    value: 1n
  }
])
```

## Definition

```ts
function encodeData(
  calls: readonly Call[],
  options?: encodeData.Options,
): `0x${string}`
```

**Source:** [src/erc7821/Execute.ts](https://github.com/wevm/ox/blob/main/src/erc7821/Execute.ts#L198)

## Parameters

### calls

* **Type:** `readonly Call[]`

The calls to encode.

### options

* **Type:** `encodeData.Options`
* **Optional**

The options.

#### options.opData

* **Type:** `0x${string}`
* **Optional**

## Return Type

The encoded data.

`0x${string}`
