Base Simulacrum
A headless CLI tool for locally testing EIP-5792 batch transactions against a simulated Base environment.
Overview
base-simulacrum allows you to test complex transaction batching (like token approvals + swaps) and gas sponsorship locally without deploying to a testnet or connecting a real wallet.
Architecture
┌────────────────────────────────────────────────────────┐
│ Simulacrum CLI Tool │
└───────────────────────────┬────────────────────────────┘
│ Spawns
▼
┌────────────────────────────────────────────────────────┐
│ Anvil Node (Local Base Fork/EVM) │
└───────────────────────────┬────────────────────────────┘
│ Exposes Local RPC
▼
┌──────────────────────────────────────────────────────────────────────┐
│ EIP-5792 State Machine (Rust Engine) │
│ │
│ 1. wallet_sendCalls parser (Batch execution) │
│ 2. Local Paymaster Simulator (Gas estimation & sponsorship) │
│ 3. wallet_getCallsStatus tracker │
└──────────────────────────────────────────────────────────────────────┘
Features
- Local EVM Simulation: Automatically spawns and manages Anvil instances
- EIP-5792 Implementation: Full
wallet_sendCallsandwallet_getCallsStatussupport - Gas Sponsorship: Mock paymaster for testing sponsored transactions
- Network Forking: Test against real contract state from Base, Ethereum, or any EVM chain
- Atomic Batching: Execute multiple transactions that succeed or fail together
- Zero External Dependencies: No browser, frontend, or live network required
- Deterministic Testing: Millisecond-fast execution against in-memory EVM
- Parallel Testing: Run multiple test suites simultaneously on different ports
Prerequisites
- Rust 1.75+
- Foundry (for
anvil)
Installation
From Source
From Crates.io (once published)
From Git Repository
Usage
Quick Start
# Basic single transaction
# Multi-call batch with gas sponsorship
# Fork from Base mainnet
All Available Commands
Run a batch transaction:
)
)
)
Check batch status:
)
)
Get help:
Real Command Examples
# 1. Simple ETH transfer
# 2. Multi-call batch with sponsorship
# 3. Custom chain ID (Ethereum mainnet)
# 4. Custom port (avoid conflicts)
# 5. Fork from Base mainnet
# 6. All options combined
# 7. Check batch status
See USAGE.md for detailed documentation and COMMANDS.md for complete command reference.
Batch Configuration Format
Create a JSON file with the following structure:
Project Structure
src/
├── main.rs # CLI entry point with clap
├── anvil.rs # Anvil process management
├── engine.rs # EIP-5792 state machine
├── paymaster.rs # Local gas sponsorship simulator
└── types.rs # Shared data structures
Testing
License
MIT