Skip to main content

EntryPoint

EntryPoint is a branded Address type representing the ERC-4337 entry point contract. The entry point is the central coordinator for account abstraction, validating and executing user operations submitted by bundlers.

Overview

The EntryPoint contract is the singleton that handles all user operations. It validates signatures, executes operations, and manages gas accounting and paymaster interactions. Voltaire provides constants for both v0.6 and v0.7 entry point addresses.
import { EntryPoint, ENTRYPOINT_V06, ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

// Use v0.7 entry point
const entryPoint = EntryPoint.from(ENTRYPOINT_V07);
console.log(EntryPoint.toHex(entryPoint));
// "0x0000000071727de22e5e9d8baf0edac6f37da032"

// Use v0.6 entry point (legacy)
const legacyEntryPoint = EntryPoint.from(ENTRYPOINT_V06);
console.log(EntryPoint.toHex(legacyEntryPoint));
// "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789"

Type Definition

import type { AddressType } from '../Address/AddressType.js';
import type { brand } from '../../brand.js';

export type EntryPointType = AddressType & { readonly [brand]: "EntryPoint" };
EntryPoint is a branded Address type. TypeScript enforces type safety through a unique Symbol brand, preventing mixing with other addresses while maintaining compatibility with Address operations.

API Reference

Constructors

from

Create EntryPoint from address input.
function from(
  value: number | bigint | string | Uint8Array | AddressType
): EntryPointType
import { EntryPoint } from '@tevm/voltaire/primitives/EntryPoint';

const entryPoint = EntryPoint.from("0x0000000071727De22E5E9d8BAf0edAc6f37da032");

Converters

toHex

Convert EntryPoint to hex string.
function toHex(
  entryPoint: number | bigint | string | Uint8Array | AddressType
): string
import { EntryPoint, ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

const hex = EntryPoint.toHex(ENTRYPOINT_V07);
console.log(hex);
// "0x0000000071727de22e5e9d8baf0edac6f37da032"

Comparisons

equals

Check if two EntryPoint addresses are equal.
function equals(
  entryPoint1: number | bigint | string | Uint8Array | AddressType,
  entryPoint2: number | bigint | string | Uint8Array | AddressType
): boolean
import { EntryPoint, ENTRYPOINT_V06, ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

console.log(EntryPoint.equals(ENTRYPOINT_V06, ENTRYPOINT_V07));
// false

const addr = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
console.log(EntryPoint.equals(ENTRYPOINT_V06, addr));
// true

Constants

ENTRYPOINT_V06

Entry point v0.6.0 address: 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 Original ERC-4337 entry point. Supports separate gas limit fields.
import { ENTRYPOINT_V06 } from '@tevm/voltaire/primitives/EntryPoint';

ENTRYPOINT_V07

Entry point v0.7.0 address: 0x0000000071727De22E5E9d8BAf0edAc6f37da032 Latest ERC-4337 entry point. Uses packed gas limits for reduced calldata size.
import { ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

Entry Point Responsibilities

The EntryPoint contract handles:
  1. Validation: Verifies user operation signatures and nonces
  2. Gas accounting: Tracks pre-verification, verification, and execution gas
  3. Paymaster interaction: Validates paymaster approval and handles gas sponsorship
  4. Execution: Calls the account contract with the operation calldata
  5. Event emission: Logs successful operations for indexing

Version Differences

v0.6.0

  • Separate callGasLimit and verificationGasLimit fields
  • Separate maxFeePerGas and maxPriorityFeePerGas fields
  • Standard UserOperation struct

v0.7.0

  • Packed gas limits: accountGasLimits (bytes32)
  • Packed fees: gasFees (bytes32)
  • PackedUserOperation struct
  • Reduced calldata size (lower bundler costs)

Usage Patterns

Submitting User Operations

import { UserOperation } from '@tevm/voltaire/primitives/UserOperation';
import { EntryPoint, ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

const userOp = UserOperation.from({
  sender: "0x742d35Cc6634C0532925a3b844Bc9e7595f251e3",
  nonce: 0n,
  initCode: "0x",
  callData: "0x...",
  callGasLimit: 100000n,
  verificationGasLimit: 200000n,
  preVerificationGas: 50000n,
  maxFeePerGas: 1000000000n,
  maxPriorityFeePerGas: 1000000000n,
  paymasterAndData: "0x",
  signature: "0x",
});

// Hash for signing
const userOpHash = UserOperation.hash(userOp, ENTRYPOINT_V07, 1);

Multi-Chain Support

import { EntryPoint, ENTRYPOINT_V07 } from '@tevm/voltaire/primitives/EntryPoint';

// Same entry point address across all chains
const mainnetEntry = EntryPoint.from(ENTRYPOINT_V07);
const optimismEntry = EntryPoint.from(ENTRYPOINT_V07);

console.log(EntryPoint.equals(mainnetEntry, optimismEntry));
// true

References