# ExecutedTx.detach

Moves the transaction's state out of the EVM as owned state.

The EVM does not accept the changes: the caller holds them and decides what to do with them.

## Imports

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

```ts [Entrypoint]
import * as ExecutedTx from 'ox/evm/ExecutedTx'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Evm, ExecutedTx, PendingState } from 'ox/evm'

const executed = Evm.transact(evm, transaction)
const { pendingState } = ExecutedTx.detach(executed)
PendingState.isEmpty(pendingState)
```

## Definition

```ts
function detach(
  executed: ExecutedTx,
): TxResult.WithState
```

**Source:** [src/evm/ExecutedTx.ts](https://github.com/wevm/ox/blob/main/src/evm/ExecutedTx.ts#L276)

## Parameters

### executed

* **Type:** `ExecutedTx`

Executed transaction.

#### executed.'~engine'

* **Type:** `Engine`

#### executed.'~resolved'

* **Type:** `boolean`

#### executed.'~result'

* **Type:** `TxResult`

#### executed.'~token'

* **Type:** `Readonly`

Identifies the transaction this handle was created for. The engine holds it
weakly, discarding the transaction once no handle can reach it.

## Return Type

The result with its detached state.

`TxResult.WithState`
