Scripts2026年7月28日·1 分钟阅读

Scaffold-ETH 2 — Full-Stack Ethereum Development Starter Kit

A modern toolkit for rapidly prototyping and deploying Solidity smart contracts with a Next.js frontend, Hardhat backend, and pre-built React hooks for wallet and contract interaction.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Scaffold-ETH 2
直接安装命令
npx -y tokrepo@latest install d76b5d38-8a60-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Scaffold-ETH 2 is an open-source toolkit that gives developers a complete starting point for building decentralized applications on Ethereum. It wires together Hardhat for smart contract development, Next.js for the frontend, and pre-built React hooks so you can go from zero to a working dApp in minutes rather than days.

What Scaffold-ETH 2 Does

  • Provides a monorepo with Hardhat and Next.js pre-configured to work together
  • Includes custom React hooks (useScaffoldContractRead, useScaffoldContractWrite) for seamless contract interaction
  • Auto-generates a debug page that lets you call any contract function from the browser
  • Supports hot-reload for both Solidity contracts and the frontend
  • Ships with wagmi and viem integrations for wallet connectivity out of the box

Architecture Overview

The project is a Yarn workspaces monorepo with two packages: a Hardhat project that compiles, tests, and deploys Solidity contracts, and a Next.js app that consumes deployed contract ABIs. A shared config keeps chain IDs, RPC endpoints, and deployed addresses in sync. The frontend uses wagmi hooks under the hood, wrapped in scaffold-specific hooks that automatically resolve contract addresses and ABIs from the deploy artifacts.

Self-Hosting & Configuration

  • Clone and install with npx create-eth@latest or fork the GitHub repository directly
  • Configure target networks in hardhat.config.ts and scaffold.config.ts
  • Set deployer private keys via .env files in the Hardhat package
  • Switch between local Hardhat Network, testnets, and mainnet with a single config change
  • Deploy the Next.js frontend to Vercel, Netlify, or any static host

Key Features

  • One-command project scaffolding with interactive chain and extension selection
  • Block explorer integration for deployed contracts
  • Burner wallets for fast local testing without MetaMask
  • TypeScript throughout both packages with strict typing
  • Extensible via community extensions for subgraphs, IPFS, and more

Comparison with Similar Tools

  • Hardhat alone requires manual frontend setup; Scaffold-ETH 2 bundles a production-ready UI
  • Foundry is faster for pure Solidity work but lacks an integrated frontend scaffold
  • thirdweb offers managed infrastructure; Scaffold-ETH 2 is fully self-hosted and open
  • Create React App + ethers needs significant boilerplate; Scaffold-ETH 2 eliminates it
  • Truffle provides similar tooling but is built on older patterns; Scaffold-ETH 2 uses modern Next.js and wagmi

FAQ

Q: Do I need to know Solidity to use Scaffold-ETH 2? A: Basic Solidity knowledge helps, but the included sample contracts and debug UI let you experiment interactively while learning.

Q: Can I deploy to chains other than Ethereum mainnet? A: Yes. Any EVM-compatible chain (Polygon, Arbitrum, Optimism, Base) works by adding the network config to Hardhat and scaffold config.

Q: Is this suitable for production dApps? A: It is designed as a prototyping starter, but many teams use it as the foundation for production apps after customizing the frontend and adding proper testing.

Q: How do I add a new smart contract? A: Create a new .sol file in packages/hardhat/contracts, write a deploy script in deploy/, then run yarn deploy. The frontend picks up the new ABI automatically.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产