# Evm.setBal

Attaches a block access list, which covered reads are served from.

The list is a coverage gate and an overlay, not a replacement: a read it does not cover is refused unless `fallback` is set, because during block validation an access outside the list means the list is wrong. A covered read is served from the list only where the list holds a write for it, and otherwise reads through to the database.

## Imports

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

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

## Examples

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

// Validating a block: an uncovered read is a failure, not a database lookup.
Evm.setBal(evm, bal)

// Executing something the block does not contain, positioned on its state.
Evm.setBal(evm, bal, { fallback: true })
```

## Definition

```ts
function setBal<asynchronous>(
  evm: Evm<asynchronous>,
  bal: Bal.Bal,
  options?: setBal.Options,
): Awaitable<asynchronous, void>
```

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

## Parameters

### evm

* **Type:** `Evm<asynchronous>`

EVM to attach to.

#### evm.'~async'

* **Type:** `asynchronous`

#### evm.'~chainId'

* **Type:** `bigint`

#### evm.'~config'

* **Type:** `{ block: Block; specId: "frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"; version?: Version; }`

The engine's current execution config.

Held so a setter can replace one half without discarding the other, since
the adapter's operation carries both.

#### evm.'~driver'

* **Type:** `asynchronous extends true ? Driver : undefined`

Drives the asynchronous source, when there is one.

#### evm.'~engine'

* **Type:** `Engine`

#### evm.block

* **Type:** `Block`

#### evm.specId

* **Type:** `"frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"`

#### evm.version

* **Type:** `Version`
* **Optional**

### bal

* **Type:** `Bal.Bal`

List to consult on reads.

### options

* **Type:** `setBal.Options`
* **Optional**

Whether uncovered reads may fall back to the database.

#### options.fallback

* **Type:** `boolean`
* **Optional**

Whether a read the list does not cover falls back to the database.

## Return Type

`Awaitable<asynchronous, void>`
