An Ethereum crowdfunding application built with Next.js, Scaffold-ETH 2, and Foundry. Contributors fund a campaign through a public smart contract. When its deadline passes, a successful campaign forwards funds to its recipient; otherwise contributors can withdraw their contributions.
- Node.js 20.18.3 or later
- Yarn 4.13.0 (via Corepack)
- Foundry
yarn installRun each command in a separate terminal:
yarn chain
yarn deploy
yarn startOpen http://localhost:3000. The overview and campaign pages show contract balances, the funding target, the deadline, and contribution controls. The contributions page lists onchain contribution events. Contract tools and a local block explorer are available for development.
yarn next:check-types
yarn next:lint
yarn testpackages/foundry/contracts: crowdfunding and recipient smart contractspackages/foundry/script: deployment scriptspackages/foundry/test: contract testspackages/nextjs/app: application pagespackages/nextjs/components: navigation and shared wallet componentspackages/nextjs/styles/globals.css: theme and layout
Redeploy with yarn deploy --reset to reset the local campaign deadline. Set your target network in packages/nextjs/scaffold.config.ts before deploying to a testnet.