This project combines a Next.js frontend with Foundry-managed smart contracts.
- Node.js 16+ and Yarn
- Foundry (forge, anvil, and cast)
├── src/ # Next.js frontend source code
├── contracts/ # Solidity smart contracts
│ ├── src/ # Contract source files
│ ├── test/ # Contract test files
│ └── script/ # Contract deployment scripts
- Install frontend dependencies:
yarn install
- Install Foundry dependencies:
cd contracts && forge install && cd ..
- Start local blockchain:
anvil
- In a new terminal, compile and deploy contracts:
cd contracts
forge build
forge script script/Counter.s.sol:CounterScript --rpc-url http://localhost:8545 --broadcast
- Start the frontend:
yarn dev
Visit http://localhost:3000
to see your app.
- Frontend:
yarn dev
- Starts Next.js development server - Contracts:
forge test
- Runs contract tests - Local blockchain:
anvil
- Starts local Ethereum node