8000 GitHub - evmts/tevm-monorepo: An Ethereum Node built to run in Browser, Bun, Deno, and Node.js
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

evmts/tevm-monorepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tevm Logo

Tevm

JavaScript-Native Ethereum Virtual Machine

CI Status NPM Version Tevm Downloads Minzipped Size Telegram Ask DeepWiki


๐Ÿš€ The EVM for TypeScript, JavaScript, and the Modern Web

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.


โœจ Why Tevm?

  • โšก 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.

๐Ÿ› ๏ธ The Tevm Ecosystem

Everything you need to build, simulate, and ship at the speed of your ideas.

1. Tevm Node: Instant, In-Memory Ethereum

Run an EVM devnet anywhereโ€”Node, browser, edge, or serverless. One line, zero dependencies.

import { createMemoryClient } from "tevm";
const client = createMemoryClient();

2. Tevm Bundler: Solidityโ€”Typed, Bundled, Native

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";
    }
  }
`;

See Bundler Quickstart โ†’

3. ZigEvm (WIP): The Smallest, Fastest Wasm EVM

A new EVM core in Zig for true browser and edge-native executionโ€”under 100kb, launching soon. Source

4. Tevm Engine (Preview): Optimistic UX for viem/wagmi

Next-gen plugin for instant optimistic updates, auto-caching, and devnet magic in your frontend.


๐Ÿ’ก What Can You Do With Tevm?

  • ๐Ÿ”„ 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.

๐Ÿ“Š Devnet Comparison

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 โœ… โœ… โœ… โœ… โŒ

๐Ÿ† Backed by the Ethereum Foundation

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

โšก Quick Start

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",
});

๐Ÿ“š Learn More


๐Ÿ‘ฅ Community


๐Ÿค Contributing

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.


๐Ÿ“„ License

Tevm is fully open source under the MIT license. See LICENSE for details.


๐Ÿšฆ Who Should Use Tevm?

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

โค๏ธ Ready to level up your Ethereum workflow?

Get Started

0