Full-stack Ethereum dApp framework with Foundry/Hardhat monorepo, Next.js frontend, and custom React hooks that auto-wire contract ABIs and addresses. Includes contract hot reload and auto-generated debug page.
Ships in scaffold-eth-2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Full-stack Ethereum dApp development framework. Monorepo with Foundry (or Hardhat) for contracts and Next.js for the frontend. Ships custom React hooks that auto-wire contract ABIs and addresses from deployment artifacts -- no manual ABI imports, no address management. Includes an auto-generated debug page that gives you read/write UI for every public function on every deployed contract.
Agents trained on pre-2024 data generate Scaffold-ETH 1 code. SE2 is a complete rewrite -- different stack, different hooks, different project structure. Every pattern below is SE2-specific.
useContractReader or scaffold-eth/hooks, that is SE1 and will not work.npx create-eth@latest defaults to Foundry. Hardhat is available via --hardhat flag but Foundry is the recommended path. Do not assume Hardhat unless the user explicitly chose it.deployedContracts.ts, not raw ABI + address -- SE2 hooks take contractName as a string (e.g., "YourContract"). The hook resolves the ABI and address from the auto-generated deployedContracts.ts file. Never pass address and abi directly to SE2 hooks.yarn deploy regenerates deployedContracts.ts -- Every time you deploy, the contract addresses and ABIs are written to packages/nextjs/contracts/deployedContracts.ts. The frontend picks up changes on next page load (hot reload in dev).externalContracts.ts is for contracts you did NOT deploy -- To interact with Uniswap, Aave, or any already-deployed protocol, add the ABI and address to externalContracts.ts. SE2 hooks then treat them the same as your own contracts.npx create-eth@latest
The CLI prompts for project name and framework choice (Foundry or Hardhat). Foundry is the default.
cd your-project
# Terminal 1: Start local chain
yarn chain
# Terminal 2: Deploy contracts
yarn deploy
# Terminal 3: Start frontend
yarn start
The frontend runs at http://localhost:3000. The debug page is at http://localhost:3000/debug.
npx create-eth@latest --hardhat
Same commands apply. The only difference is packages/hardhat instead of packages/foundry.
your-project/
├── packages/
│ ├── foundry/ # Smart contracts (default)
│ │ ├── contracts/ # Solidity source files
│ │ ├── script/ # Deploy scripts (Deploy.s.sol)
│ │ ├── test/ # Foundry tests
│ │ └── foundry.toml # Foundry configuration
│ │
│ └── nextjs/ # Frontend
│ ├── app/ # Next.js App Router pages
│ │ ├── page.tsx # Home page
│ │ ├── debug/ # Auto-generated debug page
│ │ └── blockexplorer/ # Built-in block explorer
│ ├── components/ # Reusable UI components
│ │ └── scaffold-eth/ # SE2 component library
│ ├── contracts/
│ │ ├── deployedContracts.ts # Auto-generated from deploys
│ │ └── externalContracts.ts # Manually added external ABIs
│ ├── hooks/
│ │ └── scaffold-eth/ # SE2 custom hooks
│ ├── utils/
│ │ └── scaffold-eth/ # SE2 utilities
│ └── scaffold.config.ts # Global SE2 configuration
│
├── package.json # Workspace root
└── yarn.lock
| File | Purpose |
|---|---|
scaffold.config.ts | Target network, polling interval, wallet autoconnect |
deployedContracts.ts | Auto-generated ABI + address map keyed by chainId and contract name |
externalContracts.ts | Manually configured ABIs for third-party contracts |
Deploy.s.sol | Foundry deploy script (or 00_deploy.ts for Hardhat) |
SE2 hooks wrap wagmi hooks with contract name resolution from deployedContracts.ts. They eliminate the need to pass ABI and address manually.
Reads a view/pure function from a deployed contract. Auto-refreshes on new blocks.
import { useScaffoldReadContract } from "~~/hooks/scaffold-eth";
function GreetingDisplay() {
const { data: greeting, isLoading } = useScaffoldReadContract({
contractName: "YourContract",
functionName: "greeting",
});
if (isLoading) return <span>Loading...</span>;
return <span>{greeting}</span>;
}
With arguments:
function BalanceOf({ account }: { account: string }) {
const { data: balance } = useScaffoldReadContract({
contractName: "YourToken",
functionName: "balanceOf",
args: [account],
});
return <span>{balance?.toString()}</span>;
}
Sends a transaction to a deployed contract. Handles wallet prompts, gas estimation, and confirmation tracking.
import { useScaffoldWriteContract } from "~~/hooks/scaffold-eth";
function SetGreeting() {
const { writeContractAsync, isMining } = useScaffoldWriteContract("YourContract");
async function handleSetGreeting() {
await writeContractAsync({
functionName: "setGreeting",
args: ["Hello from SE2"],
});
}
return (
<button onClick={handleSetGreeting} disabled={isMining}>
{isMining ? "Mining..." : "Set Greeting"}
</button>
);
}
With ETH value:
function BuyTokens() {
const { writeContractAsync, isMining } = useScaffoldWriteContract("Vendor");
async function handleBuy() {
await writeContractAsync({
functionName: "buyTokens",
value: parseEther("0.1"),
});
}
return (
<button onClick={handleBuy} disabled={isMining}>
{isMining ? "Buying..." : "Buy Tokens (0.1 ETH)"}
</button>
);
}
Returns the full contract info (ABI, address) for a deployed contract on the current chain.
import { useDeployedContractInfo } from "~~/hooks/scaffold-eth";
function ContractInfo() {
const { data: contractInfo, isLoading } = useDeployedContractInfo("YourContract");
if (isLoading) return <span>Loading contract info...</span>;
if (!contractInfo) return <span>Contract not found on this chain</span>;
return (
<div>
<p>Address: {contractInfo.address}</p>
<p>Functions: {contractInfo.abi.filter(item => item.type === "function").length}</p>
</div>
);
}
Executes multiple contract writes in sequence. Useful for approve-then-execute patterns.
import { useScaffoldMultiWriteContract } from "~~/hooks/scaffold-eth";
function ApproveAndDeposit() {
const { writeContractsAsync, isMining } = useScaffoldMultiWriteContract();
async function handleDeposit() {
await writeContractsAsync({
calls: [
{
contractName: "YourToken",
functionName: "approve",
args: ["0xVaultAddress", parseEther("100")],
},
{
contractName: "Vault",
functionName: "deposit",
args: [parseEther("100")],
},
],
});
}
return (
<button onClick={handleDeposit} disabled={isMining}>
{isMining ? "Processing..." : "Approve & Deposit"}
</button>
);
}
Low-level hook for custom transaction flows. Handles notifications, error display, and block explorer links.
import { useTransactor } from "~~/hooks/scaffold-eth";
import { usePublicClient, useWalletClient } from "wagmi";
function CustomTransaction() {
const writeTx = useTransactor();
const { data: walletClient } = useWalletClient();
const publicClient = usePublicClient();
async function handleSend() {
if (!walletClient) return;
const hash = await walletClient.sendTransaction({
to: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
value: parseEther("0.01"),
});
await writeTx(
() => publicClient.waitForTransactionReceipt({ hash }),
{ blockConfirmations: 1 }
);
}
return <button onClick={handleSend}>Send 0.01 ETH</button>;
}
Fetches historical events from a deployed contract.
import { useScaffoldEventHistory } from "~~/hooks/scaffold-eth";
function TransferHistory() {
const { data: events, isLoading } = useScaffoldEventHistory({
contractName: "YourToken",
eventName: "Transfer",
fromBlock: 0n,
// Optional filters
filters: { from: "0xSenderAddress" },
// Fetch block timestamps
blockData: true,
});
if (isLoading) return <p>Loading events...</p>;
return (
<ul>
{events?.map((event, i) => (
<li key={i}>
{event.args.from} sent {event.args.value?.toString()} to {event.args.to}
</li>
))}
</ul>
);
}
Subscribes to new events in real time.
import { useScaffoldWatchContractEvent } from "~~/hooks/scaffold-eth";
function LiveTransfers() {
useScaffoldWatchContractEvent({
contractName: "YourToken",
eventName: "Transfer",
onLogs: (logs) => {
logs.forEach((log) => {
console.log("Transfer:", log.args.from, "->", log.args.to, log.args.value);
});
},
});
return <p>Listening for transfers...</p>;
}
When you modify a Solidity file and run yarn deploy:
Deploy.s.solpackages/foundry/deployments/packages/nextjs/contracts/deployedContracts.tsThe entire cycle takes seconds. No manual ABI copying, no address pasting.
// packages/foundry/script/Deploy.s.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {ScaffoldETHDeploy} from "./DeployHelpers.s.sol";
import {YourContract} from "../contracts/YourContract.sol";
contract DeployScript is ScaffoldETHDeploy {
function run() external ScaffoldEthDeployerRunner {
YourContract yourContract = new YourContract(msg.sender);
deployments.push(Deployment("YourContract", address(yourContract)));
}
}
// packages/hardhat/deploy/00_deploy_your_contract.ts
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;
await deploy("YourContract", {
from: deployer,
args: [deployer],
log: true,
autoMine: true,
});
};
export default deployYourContract;
deployYourContract.tags = ["YourContract"];
The debug page at /debug auto-generates a complete UI for every deployed contract. For each public function it renders:
This is the fastest way to test contract logic without writing any frontend code. During development, deploy your contract and immediately interact with every function from the browser.
The debug page reads from the same deployedContracts.ts that the hooks use, so it always reflects your latest deployment.
yarn chain # Starts Anvil (Foundry) or Hardhat Network
yarn deploy # Deploys to local chain
yarn start # Starts Next.js at localhost:3000
Local chain provides:
scaffold.config.ts:// packages/nextjs/scaffold.config.ts
import { defineConfig } from "@scaffold-eth/config";
const scaffoldConfig = defineConfig({
targetNetworks: [chains.sepolia],
pollingInterval: 30000,
onlyLocalBurnerWallet: false,
walletAutoConnect: true,
});
export default scaffoldConfig;
# Foundry
cd packages/foundry
echo "DEPLOYER_PRIVATE_KEY=0x..." > .env
# Hardhat
cd packages/hardhat
echo "DEPLOYER_PRIVATE_KEY=0x..." > .env
# Foundry
yarn deploy --network sepolia
# Hardhat
yarn deploy --network sepolia
scaffold.config.ts to target mainnetTo interact with contracts you did not deploy (Uniswap, Aave, ENS, etc.), add them to externalContracts.ts.
// packages/nextjs/contracts/externalContracts.ts
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const externalContracts = {
1: {
// Mainnet chain ID
DAI: {
address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
abi: [
{
name: "balanceOf",
type: "function",
stateMutability: "view",
inputs: [{ name: "account", type: "address" }],
outputs: [{ name: "", type: "uint256" }],
},
{
name: "transfer",
type: "function",
stateMutability: "nonpayable",
inputs: [
{ name: "to", type: "address" },
{ name: "amount", type: "uint256" },
],
outputs: [{ name: "", type: "bool" }],
},
{
name: "approve",
type: "function",
stateMutability: "nonpayable",
inputs: [
{ name: "spender", type: "address" },
{ name: "amount", type: "uint256" },
],
outputs: [{ name: "", type: "bool" }],
},
] as const,
},
},
} as const;
export default externalContracts;
Once configured, SE2 hooks treat external contracts exactly like your own:
function DaiBalance({ account }: { account: string }) {
const { data: balance } = useScaffoldReadContract({
contractName: "DAI",
functionName: "balanceOf",
args: [account],
});
return <span>{balance?.toString()}</span>;
}
External contracts also appear on the debug page.
# From project root
yarn vercel
Or connect the GitHub repo to Vercel:
packages/nextjsNEXT_PUBLIC_ALCHEMY_API_KEY (or your RPC provider key)NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID# Foundry -- after deploying to a live network
yarn verify --network sepolia
# Hardhat
yarn hardhat-verify --network sepolia
Verification requires an Etherscan API key set in the environment:
# packages/foundry/.env or packages/hardhat/.env
ETHERSCAN_API_KEY=your_api_key
scaffold.config.ts targeting the production chainonlyLocalBurnerWallet set to false (or true to disable burner wallet)import { defineConfig } from "@scaffold-eth/config";
import * as chains from "viem/chains";
const scaffoldConfig = defineConfig({
// Chain(s) your dApp targets -- first chain is the default
targetNetworks: [chains.hardhat],
// RPC polling interval in milliseconds
pollingInterval: 30000,
// Alchemy API key for production RPCs
alchemyApiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY ?? "",
// WalletConnect project ID
walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? "",
// Show burner wallet only on local chains
onlyLocalBurnerWallet: true,
// Auto-connect wallet on page load
walletAutoConnect: true,
});
export default scaffoldConfig;
Target multiple chains by adding them to the array:
const scaffoldConfig = defineConfig({
targetNetworks: [chains.mainnet, chains.sepolia, chains.optimism],
// ...
});
SE2 uses the first chain in the array as the default. Users can switch chains via the built-in network switcher component.
SE2 includes a built-in burner wallet for local development. It auto-generates a private key stored in localStorage and funds itself from the local chain faucet. The burner wallet is disabled on live networks when onlyLocalBurnerWallet is true.
SE2 ships reusable components in packages/nextjs/components/scaffold-eth/:
| Component | Purpose |
|---|---|
<Address> | Displays an address with ENS resolution, copy button, and block explorer link |
<Balance> | Shows ETH balance for an address |
<EtherInput> | Input field with ETH/USD conversion |
<AddressInput> | Input field with ENS resolution and address validation |
<IntegerInput> | Input field for uint256 with bigint handling |
<RainbowKitCustomConnectButton> | Wallet connect button with chain info |
<BlockieAvatar> | Blockie identicon for addresses |
Usage:
import { Address, Balance, EtherInput } from "~~/components/scaffold-eth";
function AccountCard({ address }: { address: string }) {
return (
<div>
<Address address={address} />
<Balance address={address} />
</div>
);
}
function ContractDashboard() {
const { data: owner } = useScaffoldReadContract({
contractName: "YourContract",
functionName: "owner",
});
const { data: totalSupply } = useScaffoldReadContract({
contractName: "YourContract",
functionName: "totalSupply",
});
const { data: isPaused } = useScaffoldReadContract({
contractName: "YourContract",
functionName: "paused",
});
return (
<div>
<p>Owner: <Address address={owner} /></p>
<p>Total Supply: {totalSupply?.toString()}</p>
<p>Status: {isPaused ? "Paused" : "Active"}</p>
</div>
);
}
import { useState } from "react";
import { useScaffoldWriteContract } from "~~/hooks/scaffold-eth";
import { AddressInput, IntegerInput } from "~~/components/scaffold-eth";
function TransferForm() {
const [to, setTo] = useState("");
const [amount, setAmount] = useState<string | bigint>("");
const { writeContractAsync, isMining } = useScaffoldWriteContract("YourToken");
async function handleTransfer() {
await writeContractAsync({
functionName: "transfer",
args: [to, BigInt(amount)],
});
}
return (
<div>
<AddressInput value={to} onChange={setTo} placeholder="Recipient" />
<IntegerInput value={amount} onChange={setAmount} placeholder="Amount" />
<button onClick={handleTransfer} disabled={isMining || !to || !amount}>
{isMining ? "Sending..." : "Transfer"}
</button>
</div>
);
}
Last verified: February 2026
docs/troubleshooting.md (opens in a new tab)examples/basic-contract/README.md (opens in a new tab)examples/external-contract/README.md (opens in a new tab)examples/production-deploy/README.md (opens in a new tab)examples/token-vendor/README.md (opens in a new tab)resources/cli-commands.md (opens in a new tab)resources/hook-reference.md (opens in a new tab)resources/project-structure.md (opens in a new tab)templates/scaffold-page.tsx (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 plugins ship this exact skill · first indexed Jul 19, 2026
Other plugins' skills for the same job
/scaffold-eth-2:scaffold-eth-2from scaffold-eth-2
npx claudepluginhub andresdefi/cryptoskills --plugin scaffold-eth-2