Empowering environmental change through blockchain technology and transparent donations
A comprehensive decentralized application (dApp) that revolutionizes environmental fundraising through blockchain technology, featuring automated micro-donations, transparent impact tracking, and a governance-driven ecosystem.
- Direct Impact Donations: Support verified environmental foundations with transparent fund allocation
- ECO Token Rewards: Earn governance tokens for every donation (10 ECO per 1 ETH)
- Auto-Donation Technology: Revolutionary micro-donation system that automatically contributes to causes with every blockchain transaction
- Multi-Foundation Support: Choose from Ocean Cleanup, Reforestation, Wildlife Conservation, and Renewable Energy initiatives
- Automatic Wallet Management: Organizations receive crypto donations without any blockchain knowledge
- Seamless Fiat Conversion: Automated ETH-to-bank-account transfers with 3% platform fee
- Professional Admin Dashboard: Complete wallet management and conversion tools for administrators
- Organization Onboarding: Traditional nonprofits can receive crypto donations with zero technical setup
- π Full Documentation
- Community-Driven Decisions: Holders of ECO tokens can vote on platform improvements and fund allocations
- Proposal System: Submit and vote on new environmental initiatives
- Transparent Governance: All decisions recorded on-chain for complete transparency
- Real-Time Impact Tracking: Visual progress indicators showing your environmental contributions
- Donation History: Comprehensive transaction history with professional table styling
- Achievement System: Unlock badges and milestones based on your giving patterns
- Statistics Overview: Track total donations, ECO balance, and environmental impact metrics
- Persistent Connection: Seamless wallet connectivity across all platform pages
- Multi-Network Support: Works with Ethereum mainnet, testnets, and local development networks
- MetaMask Optimization: Enhanced integration with the most popular Web3 wallet
- Professional UI/UX: Modern design with smooth animations and responsive layouts
- Mobile-First Design: Optimized for all devices and screen sizes
- Accessibility: WCAG compliant interface ensuring inclusive access
- Progressive Web App: Fast loading with offline capabilities
π¦ Smart Contracts
βββ πͺ EcoCoin.sol # ERC20 governance token with minting controls
βββ π Donation.sol # Core donation logic with foundation management
βββ π€ AutoDonation.sol # Automated micro-donation subscription service
βββ ποΈ EcoGovernance.sol # DAO governance and proposal management
π¦ Frontend Application
βββ π index.html # Landing page with hero section
βββ π donate.html # Interactive donation interface
βββ π dashboard.html # Personal impact dashboard
βββ π history.html # Transaction history viewer
βββ π’ foundation.html # Foundation profiles and information
βββ π³οΈ governance.html # DAO governance interface
βββ π¨ css/ # Modular CSS architecture
βββ β‘ js/modules/ # Modular JavaScript components
βββ π± assets/ # Images, videos, and static resources
π¦ Development Environment
βββ βοΈ hardhat.config.js # Blockchain development configuration
βββ π scripts/deploy.js # Smart contract deployment automation
βββ π§ͺ test/ # Comprehensive test suite
βββ π create-sample-*.js # Demo data generation scripts
βββ π§ network-config.js # Multi-network deployment settings
- Solidity ^0.8.0: Latest security features and gas optimizations
- Hardhat: Professional Ethereum development environment
- OpenZeppelin: Battle-tested smart contract libraries
- Ethers.js v5: Modern Ethereum library for blockchain interactions
- Vanilla JavaScript: Lightweight, fast, and SEO-friendly
- Modern CSS3: Advanced animations, grid layouts, and responsive design
- Progressive Enhancement: Works without JavaScript, enhanced with it
- Vite: Lightning-fast development server and build tool
- ESLint: Code quality and consistency enforcement
- Prettier: Automated code formatting
- GitHub Actions: Continuous integration and deployment
- Hardhat Network: Local blockchain for development and testing
- Node.js 18+ and npm
- MetaMask browser extension
- Git for version control
# Clone the repository
git clone https://github.com/MitPete/Eco---Donations-
cd Eco---Donations-
# Install dependencies
npm install
# Install frontend dependencies
cd frontend
npm install# Start local blockchain (Terminal 1)
npx hardhat node
# Deploy contracts to local network (Terminal 2)
npx hardhat run scripts/deploy.js --network localhost
# Start frontend development server (Terminal 3)
cd frontend
npm start- Frontend: http://localhost:5173
- Local Blockchain: http://127.0.0.1:8545
- Chain ID: 31337 (for MetaMask configuration)
Add local network to MetaMask:
- Network Name: Hardhat Local
- RPC URL: http://127.0.0.1:8545
- Chain ID: 31337
- Currency Symbol: ETH
- Connect Wallet: Click "Connect Wallet" on any page
- Choose Foundation: Select from our verified environmental partners
- Set Amount: Enter your donation amount in ETH
- Add Message: Include an optional message for transparency
- Confirm Transaction: Sign the transaction in MetaMask
- Earn Rewards: Receive ECO tokens automatically
- Access Dashboard: Navigate to your personal dashboard
- Find Auto-Donation Section: Scroll to the automated giving section
- Configure Settings: Choose fixed amount or percentage-based donations
- Set Limits: Establish monthly spending caps for protection
- Select Cause: Pick your preferred environmental focus
- Activate: Save settings and start effortless giving
- Hold ECO Tokens: Ensure you have governance tokens from donations
- View Proposals: Check active proposals on the governance page
- Research & Discuss: Review proposal details and community feedback
- Cast Vote: Submit your vote using your ECO token voting power
- Track Results: Monitor proposal outcomes and implementation
# Run all smart contract tests
npx hardhat test
# Run tests with gas reporting
REPORT_GAS=true npx hardhat test
# Run specific test file
npx hardhat test test/DonationContract.js
# Run tests on specific network
npx hardhat test --network localhost- β Unit Tests: Individual contract function testing
- β Integration Tests: Cross-contract interaction testing
- β Edge Case Testing: Boundary condition and error handling
- β Gas Optimization: Cost analysis and optimization verification
- Slither Analysis: Automated vulnerability detection
- OpenZeppelin Standards: Industry-standard security practices
- Manual Review: Line-by-line security assessment
- Community Testing: Open-source transparency and peer review
- Reentrancy Protection: OpenZeppelin's ReentrancyGuard implementation
- Access Control: Role-based permissions and ownership patterns
- Input Validation: Comprehensive parameter checking and sanitization
- Safe Math Operations: Overflow/underflow protection with Solidity 0.8+
- CSP Headers: Content Security Policy for XSS prevention
- Input Sanitization: Client-side validation and encoding
- Secure Communication: HTTPS enforcement and secure headers
- Wallet Security: Best practices for private key protection
# Deploy to Sepolia testnet
npx hardhat run scripts/deploy.js --network sepolia
# Verify contracts on Etherscan
npx hardhat verify --network sepolia <CONTRACT_ADDRESS># Deploy to Ethereum mainnet
npx hardhat run scripts/deploy.js --network mainnet
# Set up production environment
npm run build
npm run deploy:production# Copy environment template
cp .env.example .env
# Configure required variables
PRIVATE_KEY=your_private_key_here
INFURA_PROJECT_ID=your_infura_project_id
ETHERSCAN_API_KEY=your_etherscan_api_key- Total Donations: $XXX,XXX+ in environmental funding
- Foundations Supported: 4 verified environmental organizations
- Trees Planted: XXX,XXX+ through reforestation initiatives
- Ocean Areas Protected: XXX+ square kilometers
- Carbon Offset: XXX+ tons of COβ equivalent
- Active Users: XXX+ verified donors
- Transactions: XXX,XXX+ completed donations
- ECO Tokens Distributed: XXX,XXX+ governance tokens
- Auto-Donations: XXX+ automated micro-donations
- Governance Proposals: XX+ community decisions
We welcome contributions from the community! Here's how you can help:
- Fork the Repository: Create your own copy for development
- Create Feature Branch:
git checkout -b feature/amazing-feature - Make Changes: Implement your improvements with tests
- Run Tests: Ensure all tests pass and coverage is maintained
- Submit Pull Request: Describe your changes and their impact
- Issues: Use GitHub issues for bug reports and feature requests
- Documentation: Help improve our documentation and guides
- Testing: Participate in beta testing and provide feedback
- Community: Join our Discord for discussions and support
- Code Style: Follow ESLint and Prettier configurations
- Testing: Include tests for all new features and bug fixes
- Documentation: Update relevant documentation for changes
- Security: Follow security best practices and report vulnerabilities
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin: MIT License
- Ethers.js: MIT License
- Hardhat: MIT License
- Node.js: MIT License
This software is provided "as is" without warranty. Users are responsible for their own due diligence when interacting with smart contracts and blockchain technology.
- Website: https://eco-donations.vercel.app
- GitHub: https://github.com/MitPete/Eco---Donations-
- Documentation: Coming soon
- Community Discord: Coming soon
- Ocean Cleanup Foundation: Ocean plastic removal initiatives
- Reforestation Alliance: Global tree planting and forest restoration
- Wildlife Conservation Society: Endangered species protection
- Renewable Energy Coalition: Clean energy development projects
- Ethereum Documentation: https://ethereum.org/developers
- Hardhat Documentation: https://hardhat.org/docs
- OpenZeppelin: https://openzeppelin.com/contracts
- Ethers.js: https://docs.ethers.io
Special thanks to:
- Environmental Partners: For their crucial work in protecting our planet
- Open Source Community: For the tools and libraries that make this possible
- Early Contributors: For testing, feedback, and improvements
- Web3 Ecosystem: For building the infrastructure for decentralized applications
Together, we can create a sustainable future through technology and transparency.