> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-devrel-859-eth-getproof-historical-proof.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Predicates and Safety

> Use validity predicates safely.

Predicates are inclusion conditions. They do not guarantee inclusion or successful execution.

## Predicate Types

| Type | Parameters |
| - | - |
| `balance` | `address`, `op`, `value` |
| `storage` | `address`, `slot`, `op`, `value`, optional `mask` |
| `block_number` | `op`, `value` |
| `flashblock_index` | `op`, `value` |

The supported operators are `<`, `<=`, `=`, `!=`, `>`, and `>=`. Predicate values use `0x`-prefixed hexadecimal strings.

## Evaluation

Base evaluates predicates against the state immediately before the transaction would execute. If any predicate is false, the transaction remains pending.

An earlier transaction can change the balance or storage value that a pending transaction watches. The pending transaction can then become eligible in the same Flashblock.

## Balance Example

```json Balance predicate lines wrap expandable theme={null}
{
  "type": "balance",
  "params": {
    "address": "0x2222222222222222222222222222222222222222",
    "op": ">=",
    "value": "0x1"
  }
}
```

## Storage Example

```json Storage predicate lines wrap expandable theme={null}
{
  "type": "storage",
  "params": {
    "address": "0x2222222222222222222222222222222222222222",
    "slot": "0x7",
    "mask": "0xff",
    "op": "=",
    "value": "0x2a"
  }
}
```

Base compares `(storage[address][slot] & mask)` with `value`. Omit `mask` to compare the full storage word.

## Block and Flashblock Position

Use `block_number` to target a block and `flashblock_index` to target a position within that Flashblock. Add separate predicates when both conditions must match. Valid `flashblock_index` values range from `1` through `10`, inclusive; the corresponding hexadecimal values are `0x1` through `0xa`.

## Safety

A predicate does not simulate a transaction. Keep critical checks in the application call.

Predicates read raw storage. They cannot call view functions or evaluate computed values. Verify the target contract's storage layout before using a storage predicate.

Do not use transaction placement as a source of randomness. Do not assume a zero-valued slot makes a CREATE2 address, proxy, or uninitialized contract safe to call.

Validity criteria are not recorded onchain. Do not include secrets in calldata or predicate values.
