Ethers.js, powered by a local EVM
@tevm/ethers plugs an in-memory Tevm node straight into ethers.js v6. Swap your
JsonRpcProvider for a TevmProvider and every call executes locally — no network, no
fork URL, no rate limits — with contracts that infer their types from the ABI.
Try the playground →
One provider, zero network
import { TevmProvider } from '@tevm/ethers'
const provider = await TevmProvider.createMemoryProvider({
miningConfig: { type: 'auto' },
})
const chainId = await provider.send('eth_chainId', [])
const blockNumber = await provider.getBlockNumber()
console.log({ chainId, blockNumber })Contracts that type themselves
Contract infers every method, argument, and return type from a const ABI — no code
generation step, no any leaking through.
import { Contract } from '@tevm/ethers'
const abi = [
{
type: 'function',
name: 'balanceOf',
stateMutability: 'view',
inputs: [{ name: 'account', type: 'address' }],
outputs: [{ name: 'balance', type: 'uint256' }],
},
] as const
const token = new Contract('0x0000000000000000000000000000000000000000', abi, provider)
const balance = await token.balanceOf('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
// ^? bigint — inferred from the ABIWhy it exists
In-memory execution
TevmProvider runs every JSON-RPC method against a local Tevm node, so tests and scripts
never touch the network.
Real ethers
It extends ethers' own JsonRpcApiProvider — every provider API, signer, and utility you
already know keeps working.
ABI-typed contracts
Contract and Interface infer methods and events from a const ABI at the type level —
typesafe calls with zero codegen.
Tevm actions built in
provider.tevm exposes the full Tevm action API — mine blocks, set balances, impersonate
accounts — from the same object.

