> ethers-js

Interact with Ethereum and EVM blockchains using ethers.js. Use when a user asks to connect to Ethereum, read blockchain data, send transactions, interact with smart contracts, or build a dApp frontend.

fetch
$curl "https://skillshub.wtf/TerminalSkills/skills/ethers-js?format=md"
SKILL.mdethers-js

ethers.js

Overview

ethers.js is the most popular library for interacting with Ethereum and EVM-compatible blockchains (Polygon, Arbitrum, Base, BSC). It handles wallet connections, contract interactions, transaction signing, and blockchain queries.

Instructions

Step 1: Setup

npm install ethers

Step 2: Read Blockchain Data

// lib/ethereum.ts — Read-only blockchain access
import { ethers } from 'ethers'

// Connect to Ethereum (read-only)
const provider = new ethers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY')

// Get ETH balance
const balance = await provider.getBalance('0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18')
console.log(ethers.formatEther(balance))    // "1.234"

// Get current block
const block = await provider.getBlockNumber()

// Get transaction
const tx = await provider.getTransaction('0x...')

Step 3: Interact with Smart Contracts

// Read from a contract (no wallet needed)
const USDC_ADDRESS = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
const ERC20_ABI = [
  'function balanceOf(address) view returns (uint256)',
  'function decimals() view returns (uint8)',
  'function symbol() view returns (string)',
  'function transfer(address to, uint256 amount) returns (bool)',
]

const usdc = new ethers.Contract(USDC_ADDRESS, ERC20_ABI, provider)
const balance = await usdc.balanceOf('0x...')
const decimals = await usdc.decimals()
console.log(ethers.formatUnits(balance, decimals))    // "1000.00"

Step 4: Send Transactions

// Write to blockchain (needs wallet)
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)
const usdcWithSigner = usdc.connect(wallet)

// Transfer USDC
const tx = await usdcWithSigner.transfer(
  '0xRecipient...',
  ethers.parseUnits('100', 6)    // 100 USDC (6 decimals)
)
await tx.wait()    // wait for confirmation
console.log('TX hash:', tx.hash)

Step 5: Frontend (MetaMask)

// Connect to user's MetaMask wallet
const provider = new ethers.BrowserProvider(window.ethereum)
const signer = await provider.getSigner()
const address = await signer.getAddress()

Guidelines

  • ethers.js v6 is current — v5 syntax is different (avoid mixing).
  • Never expose private keys in frontend code — use MetaMask/WalletConnect for user wallets.
  • Use Alchemy, Infura, or QuickNode as RPC providers — don't run your own node unless needed.
  • Always await tx.wait() before confirming success — tx.hash alone doesn't mean it's mined.

> related_skills --same-repo

> zustand

You are an expert in Zustand, the small, fast, and scalable state management library for React. You help developers manage global state without boilerplate using Zustand's hook-based stores, selectors for performance, middleware (persist, devtools, immer), computed values, and async actions — replacing Redux complexity with a simple, un-opinionated API in under 1KB.

> zoho

Integrate and automate Zoho products. Use when a user asks to work with Zoho CRM, Zoho Books, Zoho Desk, Zoho Projects, Zoho Mail, or Zoho Creator, build custom integrations via Zoho APIs, automate workflows with Deluge scripting, sync data between Zoho apps and external systems, manage leads and deals, automate invoicing, build custom Zoho Creator apps, set up webhooks, or manage Zoho organization settings. Covers Zoho CRM, Books, Desk, Projects, Creator, and cross-product integrations.

> zod

You are an expert in Zod, the TypeScript-first schema declaration and validation library. You help developers define schemas that validate data at runtime AND infer TypeScript types at compile time — eliminating the need to write types and validators separately. Used for API input validation, form validation, environment variables, config files, and any data boundary.

> zipkin

Deploy and configure Zipkin for distributed tracing and request flow visualization. Use when a user needs to set up trace collection, instrument Java/Spring or other services with Zipkin, analyze service dependencies, or configure storage backends for trace data.

┌ stats

installs/wk0
░░░░░░░░░░
github stars17
███░░░░░░░
first seenMar 17, 2026
└────────────

┌ repo

TerminalSkills/skills
by TerminalSkills
└────────────

┌ tags

└────────────