BitGive is a decentralized charity platform built on blockchain technology that connects donors directly with charitable campaigns. The platform enables transparent tracking of donations, provides NFT rewards to donors, and ensures that funds reach their intended recipients with minimal overhead.
- Features
- Architecture
- Smart Contracts
- Getting Started
- Development
- Testing
- Deployment
- UI Components
- Contributing
- License
- Transparent Campaigns: Create and manage charitable campaigns with full transparency
- Direct Donations: Make donations directly to campaigns using cryptocurrency
- NFT Rewards: Receive unique NFT rewards based on donation tiers
- Verification System: Campaigns are verified by trusted verifiers
- Impact Tracking: Track the impact of donations through campaign updates
BitGive is built using:
- Blockchain: Ethereum-compatible networks
- Smart Contracts: Solidity contracts for core functionality
- Frontend: Next.js with Tailwind for the user interface
The platform consists of the following core smart contracts:
- BitGiveRegistry: Central registry that manages platform configuration, roles, and contract addresses
- CampaignManager: Manages the creation, verification, and lifecycle of all campaigns
- DonationManager: Manages donation processing and record-keeping
- NFTReward: ERC-721 contract that issues NFT rewards to donors
graph TD;
A["BitGiveRegistry"]-->B["CampaignManager"]
A-->C["DonationManager"]
A-->D["NFTReward"]
C-->D
C-->B
B-->A
- Node.js v16+
- npm or yarn
- MetaMask or another Ethereum wallet
-
Clone the repository:
git clone https://github.com/michojejunle/BitGive.git cd BitGive -
Install dependencies:
cd smart-contract npm install -
Compile the smart contracts:
npx hardhat compile
-
Add enviroment variables
PINATA_API_KEY=your-pinata-api-key PINATA_API_SECRET=your-pinata-api-secret NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your-thirdweb-client-id -
Run the frontend development server:
cd frontend npm install --legacy-peer-deps or pnpm install npm run dev or pnpm dev -
Open your browser and navigate to
http://localhost:3000
BitGive includes a comprehensive test suite for all smart contracts. The tests cover individual contract functionality, edge cases, and integration between contracts.
Run all tests:
cd smart-contract
npx hardhat test
Run specific test file:
npx hardhat test test/BitGiveRegistry.test.ts
Generate test coverage report:
npx hardhat coverage
The test suite is organized as follows:
- Unit Tests: Individual contract functionality
- Integration Tests: Interactions between contracts
- Edge Cases: Handling of unexpected inputs and conditions
- Access Control: Verification of role-based permissions
- State Changes: Validation of contract state changes
-
Configure your
.envfile with your private key and network details:PRIVATE_KEY=your_private_key ROOTSTOCK_TESTNET_RPC_URL=you-alchemy-rpc-url -
Deploy to a testnet (e.g., RootstockTestnet): Create your ignition module (i.e. /ignition/modules/BitGiveRegistry.ts)
// This setup uses Hardhat Ignition to manage smart contract deployments. // Learn more about it at https://hardhat.org/ignition import { buildModule } from "@nomicfoundation/hardhat-ignition/modules"; const BitGiveRegistryModule = buildModule("BitGiveRegistryModule", (m) => { const BitGiveRegistry = m.contract("BitGiveRegistry"); return { BitGiveRegistry }; }); export default BitGiveRegistryModule;npx hardhat ignition deploy ./ignition/modules/BitGiveRegistry.ts --network rootstock --verify
For mainnet deployment, follow the same steps as testnet but use the mainnet network:
npx hardhat ignition deploy ./ignition/modules/BitGiveRegistry.ts --network rootstockMainnet --verify
The BitGive platform includes the following key UI components:
The dashboard provides an overview of:
- Featured campaigns
- Recent donations
- Platform statistics
Users can create campaigns by providing:
- Campaign name and description
- Funding goal and duration
- Category and impact metrics
- Campaign image
The donation process includes:
- Connecting a wallet
- Selecting a campaign
- Choosing a donation amount
- Confirming the transaction
- Receiving an NFT reward if donation amount meets requirements
Donors can view their NFT rewards in the gallery, which displays:
- NFT image and metadata
- Campaign information
- Tier information
bitgive/
├── smart-contract/ # Smart contracts
│ ├── BitGiveRegistry.sol
│ ├── CampaignManager.sol
│ ├── DonationManager.sol
│ └── NFTReward.sol
├── test/ # Test files
│ ├── BitGiveRegistry.test.ts
│ ├── CampaignManager.test.ts
│ ├── DonationManager.test.ts
│ ├── NFTReward.test.ts
│ ├── Integration.test.ts
│ └── helpers.ts
├── frontend/ # Next.js frontend application
└── README.md # Project documentation
Contributions are welcome to the BitGive platform! Please follow these steps to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code follows our coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact:
- Email: michojekunle1@gmail.com
- Twitter: @devvmichael



