Skip to content

This repository contains the Solidity smart contracts and frontend code for ImpactWallet, a decentralized application built for a university course on Decentralized Systems. ImpactWallet enables users to seamlessly donate cryptocurrencies to various charitable causes directly through a user-friendly web interface.

License

Notifications You must be signed in to change notification settings

parsamlm/ImpactWallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImpactWallet

ImpactWallet is a decentralized application (dApp) built on the Ethereum blockchain that facilitates donations to various charities. The project includes a smart contract, a web3 utility module, and a frontend application. The key components and features of the project are as follows:

The smart contract for this project is developed using Solidity programming language. The ImpactWallet is designed to manage and facilitate donations to various charities. It includes the following key features:

  1. Admin Management: The contract has an admin role that can add new charities and review charity proposals. The admin can also transfer the admin role to another address.
  2. Charity Management: Charities are stored in a mapping with unique IDs. The admin can add new charities directly.
  3. Charity Proposals: Users can propose new charities. Each proposal includes the charity's name, address, proposer, and approval status. The admin reviews these proposals and can approve or reject them.
  4. Donations: Users can donate to approved charities. Donations are transferred directly to the charity's address, and a Donation event is emitted.
  5. Events: The contract emits events for donations, charity proposals, approvals, and rejections to facilitate tracking and transparency.
  6. Modifiers: The contract uses modifiers to restrict access to certain functions (e.g., only the admin can call specific functions) and to ensure that charities exist before allowing donations.
  7. Fallback Function: The contract includes a fallback function that reverts any direct transfers, ensuring that donations are made through the designated function.

This contract ensures a structured and transparent process for managing and donating to charities on the Ethereum blockchain.

This smart contract is published and verified on Sepolia.etherscan. You can see the contract using this link.

The web3.ts file is a utility module for interacting with an Ethereum smart contract using the ethers.js library. It includes functions for connecting to a wallet, checking admin status, managing charities, handling donations, and retrieving donation data. Key functionalities include:

  • Wallet Connection: Connects to MetaMask and initializes the contract instance.
  • Admin Functions: Checks if the user is an admin and transfers admin rights.
  • Charity Management: Adds new charities and proposes new charity entries.
  • Donation Handling: Allows users to donate to charities and retrieves donation history.
  • Event Handling: Fetches unique donors, total donations by a donor, top donors, and donation history by address.

This module ensures seamless interaction with the smart contract for managing and tracking donations.

The Home Page is a React component written in TypeScript that allows users to interact with the Impact Wallet smart contract. Key features include:

  • Wallet Connection: Connects to MetaMask and checks if the user is an admin.
  • Donation: Allows users to donate to approved charities by selecting an organization and specifying a donation amount.
  • Charity Proposal: Enables users to propose new charity organizations.
  • Donation History: Displays the donation history of the connected wallet with pagination.
  • Top Donors: Shows a list of top donors based on their total donations.

The Admin Page is a React component written in TypeScript that provides an interface for administrators to manage charity organizations and monitor donation activities. Key features include:

  • Wallet Connection: Connects to MetaMask to verify if the user is an admin.
  • Organization Management: Allows admins to approve or reject charity proposals, add new charities, and view lists of pending, approved, and rejected charities.
  • Administration Management: Enables the transfer of admin rights to another wallet address.
  • Monitoring: Displays donation history for a specific wallet address.
  • Pagination: Implements pagination for viewing donation history.
  • Loading States: Shows loading dialogs during asynchronous operations.

Screenshots

Home Page

ImpactWallet Home Page

ImpactWallet Home Page

ImpactWallet Home Page

Admin Page

ImpactWallet Admin Page

ImpactWallet Admin Page

ImpactWallet Admin Page

Disclaimer

This project is provided "as is" without any warranties of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. Use this project at your own risk. The authors and contributors are not responsible for any damages or losses that may arise from the use of this project.

MIT License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

This repository contains the Solidity smart contracts and frontend code for ImpactWallet, a decentralized application built for a university course on Decentralized Systems. ImpactWallet enables users to seamlessly donate cryptocurrencies to various charitable causes directly through a user-friendly web interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •