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.
BitGive is built using:
The platform consists of the following core smart contracts:
graph TD;
A["BitGiveRegistry"]-->B["CampaignManager"]
A-->C["DonationManager"]
A-->D["NFTReward"]
C-->D
C-->B
B-->A
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:
Configure your .env
file 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
⚠️ Important: Always thoroughly test on testnets before deploying to mainnet.
The BitGive platform includes the following key UI components:
The dashboard provides an overview of:
Users can create campaigns by providing:
The donation process includes:
Donors can view their NFT rewards in the gallery, which displays:
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:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)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: