This repository contains the Solidity smart contracts for a permissioned-chain aid-tracking protocol designed for NGOs and aid organizations worldwide. The protocol enables transparent, accountable, and auditable tracking of aid project funding, expenses, and dispute resolution, leveraging blockchain technology to ensure trust among donors, NGOs, validators, and the community.
Aid and NGO fund distribution globally often suffers from a lack of transparency, inefficient reporting, and limited community oversight. This project aims to:
- Digitize and standardize the tracking of aid and NGO projects and their expenses.
- Empower NGOs and aid organizations to transparently manage projects and budgets.
- Enable validators to approve or reject expenses.
- Allow the community to flag suspicious expenses and participate in dispute resolution.
- Provide an immutable, auditable record of all transactions and decisions.
- Transparency: All project and expense data is on-chain, visible, and auditable by all stakeholders.
- Accountability: Only authorized NGOs can create projects; only approved collaborators can submit expenses; only validators can approve expenses.
- Community Oversight: Community members can flag expenses, and a DAO of validators resolves disputes.
- Automation: Smart contracts enforce rules, roles, and time windows, reducing manual errors and corruption.
- Solidity (>=0.8.0): For writing secure, modern smart contracts.
- OpenZeppelin Contracts: Industry-standard libraries for ERC-721, AccessControl, and security best practices.
- Hardhat: Development environment for compiling, testing, and deploying contracts.
- Ethers.js: For contract interaction and deployment scripting.
- Sepolia Testnet: For public test deployments.
backend-contracts/
contracts/ # All Solidity smart contracts
AccessRoles.sol
ProjectNFT.sol
ExpenseTracker.sol
DisputeResolution.sol
scripts/ # Deployment and utility scripts
deploy-sepolia.js
test/ # Automated tests
hardhat.config.js # Hardhat configuration
package.json # Project dependencies and scripts
README.md # Project documentation
- Node.js (v16 or later)
- npm
- Hardhat
- An Infura or Alchemy API key for Sepolia
- A funded Ethereum account (for Sepolia testnet deployment)
cd backend-contracts
npm installCreate a .env file in backend-contracts/ with the following:
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
DEPLOYER_PRIVATE_KEY=your_private_key_here
npx hardhat compilenpx hardhat run scripts/deploy-sepolia.js --network sepoliaDeployment addresses will be printed to the console.
npx hardhat test- ProjectNFT: ERC-721 NFT representing aid projects, mintable only by authorized NGOs, with on-chain metadata.
- ExpenseTracker: Maps each project to multiple expenses, allowing collaborators to submit and validators to approve expenses.
- DisputeResolution: Allows community members to flag expenses and validators to resolve disputes via DAO voting.
- AccessRoles: Defines all role constants for protocol-wide access control.
A frontend dApp for interacting with these contracts will be implemented at a later stage.
MIT