JavaScript-Native Ethereum Virtual Machine
Tevm puts an Ethereum node anywhere JavaScript runsโNode, browser, serverless, edge, or desktop. Instantly fork mainnet, simulate complex contracts, and run full-stack devnets, all with TypeScript-first safety and blazing speed.
If you use viem, wagmi, 0x, or build modern Ethereum apps, Tevm is the engine that powers next-level shipping, testing, and UX.
- โก Ship at Lightspeed: Instant feedback. Test and deploy with no wait, no Docker, no slow subprocesses. Build and iterate like the Rust and Go eliteโnow in JS and Zig.
- ๐ซ Goodbye, Loading Spinners: Deliver real optimistic UI. Run every contract locally for true instant dapp experiencesโno more waiting on RPCs.
- ๐ TypeScript-Native Confidence: End-to-end type safety and autocompletion. Import Solidity, call contracts, and simulate transactions with zero guesswork.
- ๐ Mainnet-Grade Simulation: Fork any EVM chainโmainnet, L2, L3โand manipulate state locally with full fidelity.
- ๐งช Unmatched Testing Power: Write robust integration tests, simulate reorgs, verify gas, and check UX edge cases, all in one toolkit.
- ๐ป True Local-First: Full EVM in Node, browser, or edgeโoffline or online, always in your control.
- ๐ฏ The Fastest Path from Idea to User: Tevm Compiler brings Solidity into your codebase with real types, letting you ship faster and safer than ever before.
- โก Optimistic Updates, Advanced Gas Modeling: Build dapps that feel like Web2 and simulate costs with precision, in JS/TS.
Everything you need to build, simulate, and ship at the speed of your ideas.
Run an EVM devnet anywhereโNode, browser, edge, or serverless. One line, zero dependencies.
import { createMemoryClient } from "tevm";
const client = createMemoryClient();
Import Solidity right into TypeScript and call it with full type safety:
import { ERC20 } from '@openzeppelin/contracts/token/ERC20.sol';
import { createMemoryClient } from 'tevm';
const client = createMemoryClient();
const token = ERC20.withAddress("0x123...");
const balance = await client.readContract(token.read.balanceOf("0x456..."));
Write contracts inline with sol
template literals (coming soon):
import { sol } from 'tevm';
const { MyContract } = sol`
contract MyContract {
function greet() public pure returns (string memory) {
return "hello";
}
}
`;
A new EVM core in Zig for true browser and edge-native executionโunder 100kb, launching soon. Source
Next-gen plugin for instant optimistic updates, auto-caching, and devnet magic in your frontend.
- ๐ Test Against Mainnet or Any Chain: Fork and simulate mainnet, L2s, L3s, and custom rollups with a single call.
- ๐ค Prototype Next-Gen Apps: From L2 fraud proofs to LLM/EVM wallets and AI agentsโin the browser or edge.
- โจ Deliver Seamless UX: Eliminate spinners. Build apps that always feel instant.
- โฝ Model Gas & Simulate Fees: Run "what if" gas scenarios and advanced fee logic, locally and reproducibly.
- ๐ Debug, Profile, and Introspect: Step through opcodes and inspect contract state in real time.
Feature | Tevm | Anvil | Hardhat | Ganache | Tenderly |
---|---|---|---|---|---|
Language | JS/Wasm (Zig WIP) | Rust | JS/Rust | JS | Go |
Browser Support | โ | โ | โ | โ | โ (SaaS) |
Minimal Dependencies | โ | โ | โ | โ | โ (SaaS) |
Viem Integration | Native | Yes (RPC) | Minimal | Minimal | None |
Forking (L1, Rollups) | โ | โ | โ | Some | โ |
Rebase/Fork Updates | Soon | โ | โ | โ | โ |
Solidity Tests | Some | Yes | Yes | No | No |
Fuzzing | โ | โ | โ | โ | โ |
Open Source | โ | โ | โ | โ | โ |
Tevm is funded by an Ethereum Foundation grant. Our roadmap:
- โ Tevm 1.0.0 Release
- ๐ Test Library
- ๐ฎ MUD Integration for onchain games
- ๐ ZigEvm Launch: Fastest Wasm EVM ever
npm install tevm viem@latest
import { createMemoryClient, http } from "tevm";
import { optimism } from "tevm/chains";
import { parseAbi } from "viem";
// Fork Optimism mainnet
const client = createMemoryClient({
common: optimism,
fork: { transport: http("https://mainnet.optimism.io") },
});
await client.tevmReady();
const account = "0x" + "baD60A7".padStart(40, "0");
await client.setBalance({ address: account, value: 10_000_000_000_000_000_000n });
const greeterAbi = parseAbi([
"function greet() view returns (string)",
"function setGreeting(string memory _greeting) public",
]);
const greeterAddress = "0x10ed0b176048c34d69ffc0712de06CbE95730748";
// Read from contract
const greeting = await client.readContract({
address: greeterAddress,
abi: greeterAbi,
functionName: "greet",
});
// Write to contract
await client.writeContract({
account,
address: greeterAddress,
abi: greeterAbi,
functionName: "setGreeting",
args: ["Hello from Tevm!"],
});
await client.mine({ blocks: 1 });
const newGreeting = await client.readContract({
address: greeterAddress,
abi: greeterAbi,
functionName: "greet",
});
- ๐ Getting Started
- ๐ Viem Integration
- ๐ฆ Ethers Integration
- ๐ ๏ธ Bundler Quickstart
- ๐ API Reference
- ๐ก Examples
- ๐ฌ Join Telegram
- ๐ฃ๏ธ GitHub Discussions
We're always looking for passionate buildersโespecially if you love TypeScript, Zig, L2/L3s, or pushing the limits of EVM tooling. See CONTRIBUTING.md to get started.
Tevm is fully open source under the MIT license. See LICENSE for details.
Tevm is for you if you're:
- ๐ง Building with viem, wagmi, 0x, or TypeScript-first Ethereum apps
- โก Shipping UIs that need instant feedback (no spinners)
- ๐ Creating next-gen dapps, rollups, wallets, or LLM/EVM integrations
- ๐ค Tired of slow, fragile, or heavyweight devnets