CrowdCoin* - Decentralized Crowdfunding Platform built on Ethereum
A blockchain-based crowdfunding platform built on Ethereum where campaign creators can raise funds and contributors have oversight on how funds are spent.
*Using the platform requires Metamask.
CrowdCoin solves the traditional crowdfunding problem of trust by using smart contracts to manage funds. Campaign creators can't spend the money without approval from contributors, ensuring transparency and accountability.
- Create campaigns with minimum contribution requirements
- Contribute to existing campaigns
- View campaign details and metrics
- Create spending requests as campaign managers
- Approve spending requests as contributors
- Finalize and process spending requests
- Frontend: React.js with Next.js framework
- UI Components: Semantic UI React
- Blockchain Interaction: Web3.js
- Smart Contracts: Solidity
- Testing: Mocha
- Ethereum Network: Sepolia Testnet
- Campaign Factory: Creates new campaign instances
- Campaign: Manages contributions and spending requests
Factory contract deployed at: 0x782F00C1Bf1E12a916f53643198Bf57500Be5436
on Sepolia testnet
crowdcoin-web3/
├── .github/workflows/ # Workflows for the repo
| └──deploy_factory.yaml # Workflow to deploy a new factory contract
├── components/ # React components
│ ├── ContributeForm.js # Form to contribute to campaigns
│ ├── Header.js # Application header with navigation
│ ├── Layout.js # Common layout wrapper
│ └── RequestRow.js # Component for displaying request details
├── ethereum/ # Ethereum related code
│ ├── build/ # Compiled contracts
│ ├── contracts/ # Smart contracts
│ │ └── Campaign.sol
│ ├── campaign.js # Campaign contract instance
│ ├── compile.js # Contract compilation script
│ ├── deploy.js # Contract deployment script
│ ├── factory.js # Factory contract instance
│ └── web3.js # Web3 configuration
├── pages/ # Next.js pages
│ ├── campaigns/ # Campaign related pages
│ │ ├── new.js # Create new campaign
│ │ ├── show.js # Campaign details
│ │ └── requests/ # Request related pages
│ │ ├── index.js # List of requests
│ │ └── new.js # Create new request
│ └── index.js # Homepage with campaigns list
├── routes.js # Custom routes configuration
└── server.js # Custom server configuration
- Node.js (v14+)
- Metamask browser extension
- Ethereum account with Sepolia ETH
- Clone the repository
git clone <repository-url>
cd crowdcoin-web3
- Install dependencies
npm install --legacy-peer-deps
- Create a .env file with your configuration using .env.example for guidance
NODE_ENV=development
MNEMONIC="your mnemonic phrase ..."
NEXT_PUBLIC_INFURA_URL="https://sepolia.infura.io/v3/12345678990..."
NEXT_PUBLIC_FACTORY_ADDRESS="0x782F00C1Bf1E12a916f53643198Bf57500Be5436"
- Compile the smart contracts (optional - already compiled)
node ethereum/compile.js
- Deploy contracts to the network (optional - already deployed)
node ethereum/deploy.js
- Run the development server
npm run dev
- Access the application at
http://localhost:3000
- Connect your Metamask wallet to the application
- Create a new campaign or contribute to existing ones
- Campaign managers can create spending requests
- Contributors can approve requests
- Campaign managers can finalize approved requests to transfer funds
Run the test suite with:
npm run test
If you encounter any errors when accessing the application, make sure:
- You're connected to the Sepolia network and your .env file is set up correctly
- Your MetaMask is properly configured and you're logged in
- You're accessing a valid campaign address