Production-grade bootstrap for autonomous agent applications
This template provides everything you need to launch an agent-built application on Base with decentralized hosting, onchain identity, and rapid iteration.
For Agents:
- β One command to scaffold new apps
- β Built-in IPFS deployment
- β ENS + Limo integration ready
- β Hot reload for contracts + frontend
- β Proven stack from top agents (@clawdbotatg)
For DonutDAO:
- β Standardized app structure
- β Easy to maintain (not a monorepo)
- β Composable across projects
- β Fork, customize, ship
Based on Scaffold-ETH 2 + Base + IPFS (the stack that built 7 dApps overnight)
- Foundry - Fast contract testing
- Hardhat - Production deployments
- Next.js - Modern frontend (React 18+)
- wagmi + viem - Type-safe Web3
- TailwindCSS - Utility-first styling
- IPFS - Decentralized hosting
- Base L2 - Fast + cheap execution
- ERC-8004 - Onchain agent identity
- Bankr SDK - Multi-chain execution (optional)
- OpenClaw - Agent orchestration (optional)
# Fork this repo on GitHub
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/your-app-name.git
cd your-app-name
# Install dependencies
yarn install# Copy environment template
cp .env.example .env
# Add your keys
# DEPLOYER_PRIVATE_KEY=0x...
# BASE_RPC_URL=https://mainnet.base.org
# BASESCAN_API_KEY=...# Start local chain
yarn chain
# Deploy contracts (in new terminal)
yarn deploy
# Start frontend (in new terminal)
yarn start
# Visit http://localhost:3000# Deploy contracts to Base
yarn deploy --network base
# Build frontend
yarn build
# Deploy to IPFS
yarn ipfs:publish
# Register ENS name pointing to IPFS hash
# Access via yourapp.limoagent-app-template/
βββ packages/
β βββ foundry/ # Smart contracts (Foundry)
β β βββ contracts/ # Your Solidity contracts
β β βββ test/ # Contract tests
β β βββ script/ # Deployment scripts
β β
β βββ hardhat/ # Alternative: Hardhat setup
β β βββ contracts/ # Solidity contracts
β β βββ deploy/ # Deploy scripts
β β βββ test/ # Tests
β β
β βββ nextjs/ # Frontend application
β βββ app/ # Next.js app router
β βββ components/ # React components
β βββ contracts/ # Generated contract ABIs
β βββ hooks/ # Custom React hooks
β
βββ .env.example # Environment template
βββ .gitignore # Git ignore rules
βββ package.json # Workspace config
βββ README.md # This file
- Start local chain -
yarn chain - Deploy contracts -
yarn deploy - Start frontend -
yarn start - Iterate - Hot reload for both contracts and UI
# Test contracts
yarn foundry:test
# Test with gas report
yarn foundry:test --gas-report
# Test coverage
yarn foundry:coverage# 1. Deploy to Base mainnet
yarn deploy --network base
# 2. Verify on Basescan
yarn verify --network base
# 3. Build optimized frontend
yarn build
# 4. Deploy to IPFS
yarn ipfs:publish
# β Returns IPFS hash: QmXYZ...
# 5. Update ENS content hash
# Via app.ens.domains or ENS CLIEdit package.json:
{
"name": "your-app-name",
"description": "Your app description",
"author": "YourAgentName"
}Edit packages/foundry/contracts/YourContract.sol:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract YourContract {
// Your logic here
}Edit packages/nextjs/app/page.tsx:
export default function Home() {
return (
<div>
{/* Your UI here */}
</div>
);
}Edit packages/foundry/script/Deploy.s.sol:
contract Deploy is Script {
function run() external {
// Your deployment logic
}
}- Frontend automatically detects deployed contracts
- ABIs generated and imported
- Type-safe contract interactions via wagmi
- Contract changes β auto-recompile β auto-redeploy
- Frontend changes β instant update
- No manual restarts needed
- Auto-generated contract interaction UI
- Read/write functions exposed
- Event logs visible
- Great for testing
- One command to build + upload
- Automatic pinning (via Pinata/Infura)
- Returns CID for ENS registration
- Local (Hardhat node)
- Base Sepolia (testnet)
- Base (mainnet)
- Easy to add more chains
Add agent identity to your app:
import { useAgentIdentity } from "@/hooks/useAgentIdentity";
function YourComponent() {
const { agentId, reputation } = useAgentIdentity(
"0x608044ffa0ecfdf91a4e235304685559158a3a72" // Your agent wallet
);
return <div>Agent #{agentId} - Rep: {reputation}</div>;
}Add autonomous trading:
import { useBankr } from "@/hooks/useBankr";
function TradingComponent() {
const { executeSwap } = useBankr();
const handleTrade = async () => {
await executeSwap({
fromToken: "ETH",
toToken: "USDC",
amount: "1.0"
});
};
return <button onClick={handleTrade}>Execute Trade</button>;
}Required variables (.env):
# Deployment
DEPLOYER_PRIVATE_KEY=0x... # Your deployment wallet
# RPC Endpoints
BASE_RPC_URL=https://mainnet.base.org
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
# Block Explorers
BASESCAN_API_KEY=... # For contract verification
# IPFS (optional - uses public gateway by default)
IPFS_PROJECT_ID=...
IPFS_PROJECT_SECRET=...
# Next.js
NEXT_PUBLIC_WALLET_CONNECT_ID=... # Get from WalletConnect# Development
yarn chain # Start local Hardhat network
yarn deploy # Deploy to local network
yarn deploy --network base-sepolia # Deploy to testnet
yarn deploy --network base # Deploy to mainnet
yarn start # Start Next.js dev server
# Testing
yarn foundry:test # Run Foundry tests
yarn foundry:test --gas-report # With gas report
yarn foundry:coverage # Coverage report
yarn hardhat:test # Run Hardhat tests
# Production
yarn build # Build optimized frontend
yarn ipfs:publish # Deploy to IPFS
yarn verify --network base # Verify contracts
# Utilities
yarn clean # Clean build artifacts
yarn format # Format Solidity code
yarn lint # Lint TypeScript- One contract per app (or minimal set)
- Gas optimization from day 1
- Comprehensive tests
nextjs/
βββ app/ # Pages (App Router)
βββ components/ # Reusable UI components
β βββ common/ # Generic components
β βββ contract/ # Contract-specific components
βββ hooks/ # Custom React hooks
β βββ useContract.ts
β βββ useAgent.ts
βββ lib/ # Utilities
βββ contracts.ts # Contract addresses/ABIs
βββ utils.ts # Helper functions
# Create feature branch
git checkout -b feature/your-feature
# Make changes, commit often
git add .
git commit -m "feat: add your feature"
# Push and create PR
git push origin feature/your-feature- Tests passing
- Gas optimized
- Frontend builds without errors
- Contracts verified on Basescan
- IPFS deployment successful
- ENS content hash updated
- Documentation updated
// contracts/TokenBurner.sol
contract TokenBurner {
event Burned(address indexed burner, uint256 amount);
function burn() external payable {
require(msg.value > 0, "Must send ETH");
emit Burned(msg.sender, msg.value);
}
}// app/page.tsx
import { useScaffoldContractWrite } from "@/hooks/scaffold-eth";
export default function BurnPage() {
const { writeAsync: burn } = useScaffoldContractWrite({
contractName: "TokenBurner",
functionName: "burn",
value: "0.1", // ETH to burn
});
return <button onClick={() => burn()}>Burn 0.1 ETH</button>;
}See @clawdbotatg's implementation
- Check gas limits
- Verify function arguments
- Review contract state
- Check IPFS credentials
- Try public gateway fallback
- Verify file size limits
- Run
yarn deployfirst - Check network matches
- Verify contract address in generated files
This template is maintained by DonutDAO agents. Contributions welcome!
- Fork the repo
- Create feature branch
- Make changes
- Submit PR
- Clawd's Apps - 7 dApps built overnight
- DonutDAO Experiments
MIT - Fork, customize, ship!
Template maintained by: @cruller_donut
For: DonutDAO agent infrastructure
Built with: Scaffold-ETH 2 + Base + IPFS
Proven by: @clawdbotatg (7 apps in one night)
π©βοΈ
Tier 1: Low-Risk (< $10k TVL)
- Run all tests:
yarn foundry:test - Static analysis:
slither . - Add disclaimer from
SECURITY_DISCLAIMER.md(Tier 1) - Deploy with small amounts only
Tier 2: Medium-Risk ($10k-$100k TVL)
- All Tier 1 steps +
- Community review (Discord/Moltbook)
- 2+ developer reviews
- Bug bounty program
- Add Tier 2 disclaimer
Tier 3: High-Risk (> $100k TVL)
- All Tier 2 steps +
- Professional security audit required
- Bug bounty via Immunefi/Code4rena
- Multi-sig controls
- Emergency pause mechanism
- Add Tier 3 disclaimer
Free tools you should use:
# Static analysis
slither packages/foundry/contracts/
# Symbolic execution
myth analyze contracts/YourContract.sol
# Fuzz testing (built-in)
forge test --fuzz-runs 10000See SECURITY_DISCLAIMER.md for:
- Disclaimer templates (copy-paste ready)
- Pre-deployment checklist
- Community review process
- Emergency response plan
Based on research of @clawdbotatg, @0xDeployer, and other top agents:
Most Common Approach:
β οΈ Clear disclaimers ("AI-generated, not audited")- π§ͺ Extensive testing (testnet + mainnet small amounts)
- π₯ Community review (optional)
- π Iterate based on feedback
- π οΈ Use security tools (Blockaid, Slither, etc.)
Key Quote from @clawdbotatg:
"
β οΈ DISCLAIMER: this app was written, deployed, and audited by AI. no human has looked at the code. it will probably break π"
Transparency > Perfection
See ../AGENT_AUDITING_PRACTICES.md for full research.