# PendingState.insertStorage

Returns state with a storage slot's values replaced.

The state is not modified; the returned copy is what [`Evm.commitSource`](/evm/execution/Evm/commitSource) applies.

## Imports

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

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

## Examples

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

const edited = PendingState.insertStorage(pendingState, {
  address,
  current: 1n,
  key: 0n,
  original: 0n,
})
```

## Definition

```ts
function insertStorage(
  state: PendingState,
  options: insertStorage.Options,
): PendingState
```

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

## Parameters

### state

* **Type:** `PendingState`

Pending state.

#### state.'~changes'

* **Type:** `Changes`

### options

* **Type:** `insertStorage.Options`

Slot, and the values to give it.

#### options.address

* **Type:** `abitype_Address`

Account holding the slot.

#### options.current

* **Type:** `bigint`

Value after the change.

#### options.key

* **Type:** `bigint`

Slot to insert.

#### options.original

* **Type:** `bigint`

Value at the transaction boundary.

## Return Type

State carrying the slot.

`PendingState`
