Skip to content

@tevm/state

The @tevm/state package provides a robust state management system for Tevm, handling Ethereum account states, contract storage, and state transitions. It offers both synchronous and asynchronous APIs for managing the EVM state.

Installation

npm install @tevm/state

Overview

The state package is responsible for:

  • Managing account states (balance, nonce, code, storage)
  • Handling state transitions and checkpoints
  • Caching and persistence of state data
  • Supporting forked chain states
  • Providing efficient state access and modification

API Reference

Enumerations

Core Types

State Management

Storage Types

Caching

Core Functions

State Creation and Management

State Operations

State Root Management

Checkpointing and Committing

  • checkpoint - Creates a state checkpoint
  • commit - Commits state changes
  • revert - Reverts to previous checkpoint

Cache Management

Genesis and Forking

Storage Operations

Usage Examples

Creating a State Manager