This project is a decentralized fundraising platform built on the Polygon network, allowing users to raise funds for social work using cryptocurrency. Users can create fundraising campaigns, donate BARK, SOL, and MATIC tokens, generate receipts, and withdraw funds securely.
- Campaign Creation: Create and manage fundraising campaigns with a title, description, target amount, and duration.
- Donations: Donate USDC, SOL, BARK, or MATIC tokens to active campaigns, with all transactions recorded on the blockchain.
- Receipt Generation: Automatically generate and access receipts for each donation.
- Fund Withdrawal: Campaign creators can withdraw funds once the campaign ends or the target amount is reached.
- User Authentication: Secure login and authentication using MetaMask or similar Ethereum-compatible wallets.
Contract is deployed on Polygon Mumbai network.
- Contract Address (CA):
- Blockchain Network: Polygon (formerly Matic Network)
- Smart Contracts: Solidity
- Frontend: React.js, Web3.js
- Backend: Node.js, Express.js
- Database: MongoDB (for non-critical data)
- Wallet Integration: MetaMask
- Node.js
- MetaMask wallet
- MongoDB (optional for storing non-critical data)
-
Clone the repository:
git clone https://github.com/bark-community/web3-fundraiser-dapp.git cd web3-fundraiser-dapp
-
Install dependencies:
npm install
-
Install Dependencies:
npm install
-
Configure Environment Variables: Create a
.env
file in the root directory and add the following:REACT_APP_POLYGON_RPC_URL=<Polygon RPC URL> REACT_APP_CONTRACT_ADDRESS=<Deployed Smart Contract Address> REACT_APP_MONGODB_URI=<MongoDB Connection String> MNEMONIC_KEY=<Your Wallet Mnemonic> INFURA_API_KEY=<Your Infura API Key> INFURA_IPFS_ID=<Your Infura IPFS ID> INFURA_IPFS_SECRET=<Your Infura IPFS Secret>
-
Compile Contracts:
npx hardhat compile
-
Deploy Contracts: Make sure you have a Polygon testnet/mainnet account with sufficient MATIC for deployment.
npx hardhat run scripts/deploy_contracts.js --network polygon
-
Run the Application:
npm start
The application will be available at
http://localhost:3000
.
- Connect your MetaMask wallet.
- Navigate to the "Create Campaign" section.
- Fill in the campaign details and submit.
- Your campaign will be recorded on the blockchain.
- Browse active campaigns.
- Select a campaign and enter the amount to donate.
- Confirm the transaction in MetaMask.
- A receipt will be generated and available for viewing.
- Campaign creators can request a withdrawal once the campaign ends or target is reached.
- Confirm the withdrawal transaction in MetaMask.
- Funds will be transferred to the campaign creator's wallet.
We welcome contributions to enhance the platform. Please fork the repository and submit pull requests.
MIT License.