Skills / Community / viem for Ethereum

viem for Ethereum

Build Ethereum interactions with viem — the modern, type-safe replacement for ethers.js. Covers public/wallet clients, transports, transactions, signing, ABI encoding/decoding, and smart-contract reads and writes with first-class TypeScript inference.

This skill makes Claude fluent in viem, the TypeScript-first Ethereum library. It wires up publicClient and walletClient over the right transports, sends and simulates transactions, signs messages and typed data, encodes and decodes ABIs, and calls smart contracts with full type inference — steering you away from ethers.js footguns toward viem's safer, tree-shakeable API.

viem ethereum web3 typescript evm

When to use

Use when building dapps or backends that talk to Ethereum or EVM chains with viem — configuring clients and transports, sending or simulating transactions, signing, encoding/decoding ABI data, reading and writing contracts, or migrating from ethers.js.

Examples

Read a contract with viem

Type-safe contract read via publicClient

Set up a viem publicClient on Base and read the balanceOf and totalSupply from this ERC-20 contract with fully typed results

Send a transaction

Simulate then write with a walletClient

Use viem to simulate a contract write, then send the transaction with a walletClient and wait for the receipt, handling revert reasons cleanly

Migrate from ethers.js

Port existing ethers code to viem

Convert this ethers.js provider and Contract code to viem, replacing BigNumber usage with native bigint and updating the ABI encoding calls
Added to wishlist