0% found this document useful (0 votes)
34 views15 pages

Block Chain

This project report outlines the development of a Blockchain-Based Charity Donation Platform using Ethereum smart contracts, allowing users to donate ETH directly to a secure smart contract. The system enhances transparency and trust by enabling donors to verify transactions on the blockchain, while ensuring that only the contract owner can withdraw funds. The project demonstrates the practical application of blockchain technology in improving the efficiency and accountability of charitable contributions.

Uploaded by

953622244047
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views15 pages

Block Chain

This project report outlines the development of a Blockchain-Based Charity Donation Platform using Ethereum smart contracts, allowing users to donate ETH directly to a secure smart contract. The system enhances transparency and trust by enabling donors to verify transactions on the blockchain, while ensuring that only the contract owner can withdraw funds. The project demonstrates the practical application of blockchain technology in improving the efficiency and accountability of charitable contributions.

Uploaded by

953622244047
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Creating a Blockchain-based Charity Donation System

A MINI PROJECT REPORT

Submitted by

Sreenithi V(953622244045)

Surabhi R S(953622244047)

BACHELOR OF TECHNOLOGY

IN

COMPUTER SCIENCE AND BUSNESS SYSTEM

RAMCO INSTITUTE OF TECHNOLOGY,

RAJAPALAYAM

APRIL 2025

CCS339-CRYPTOCURENCY AND BLOCKCHAIN TECHNOLOGY


ABSTRACT

Blockchain technology offers a promising solution for building transparent,


secure, and decentralized systems. This project proposes a Blockchain-Based
Charity Donation Platform implemented using Ethereum smart contracts. The
platform allows users to send donations in the form of ETH (Ether), directly to a
smart contract. The donated funds are securely stored and can only be
withdrawn by the contract owner, ensuring full transparency and control over
the collected funds.
The smart contract is written in Solidity and deployed on the Sepolia Ethereum
test network using Remix IDE and MetaMask. Donors interact with the
platform through a web-based interface developed using HTML, JavaScript,
and Web3.js. This interface allows users to connect their MetaMask wallet,
make donations, and view the balance of the contract. The withdrawal
functionality is restricted to the owner only, as defined in the contract logic.
Transactions are fully transparent and verifiable through blockchain explorers
like Sepolia Etherscan.
This mini project showcases the utility of Ethereum smart contracts in
managing charitable contributions without the need for intermediaries, while
promoting transparency and accountability. The system can potentially reduce
fraud, improve trust in online fundraising, and serve as a prototype for NGOs
and non-profits aiming to leverage blockchain for donor engagement and
operational efficiency. Testing was done with Sepolia ETH, and transactions
were verified using real blockchain tools.
INTRODUCTION:
Traditional donation platforms often rely on third-party intermediaries and
manual handling of funds, which can lead to inefficiencies, delays, and lack of
transparency. These centralized systems require users to trust the platform
operators to handle funds responsibly. Additionally, many of these platforms
charge high transaction or processing fees, reducing the effective amount that
reaches the intended recipients. The lack of traceability in fund usage often
leads to donor skepticism and reduced confidence in charitable organizations.
With blockchain technology, particularly Ethereum, it becomes possible to
automate and secure the donation process using smart contracts. This mini
project explores the application of smart contracts in a decentralized charity
platform that provides a tamper-proof and verifiable record of every transaction.
Through the use of smart contracts, we ensure that funds are collected,
managed, and disbursed transparently without relying on any third-party
authority.
The objective is to create a decentralized application (dApp) where users can
contribute ETH to a contract deployed on the Ethereum blockchain. All
transactions are recorded and publicly accessible, offering complete
transparency to donors. The system ensures that only the contract owner can
access and withdraw the funds. Using MetaMask and Web3.js, we enable
browser-based interaction with the deployed contract.
This project emphasizes the practical implementation of blockchain principles
to support a real-world use case with societal impact. It not only highlights the
power of decentralization but also aims to build trust between donors and
recipients by ensuring visibility and accountability in the fundraising process.
METHODOLOGY
The methodology for implementing an Ethereum smart contract for a
blockchain-based charity donation platform involves a structured approach
encompassing requirement analysis, smart contract design and development,
front-end integration, testing, and evaluation. This section outlines the tools,
frameworks, and procedures used throughout the project.
1. Requirement Analysis and System Design The project begins with a
thorough analysis of the requirements for a secure and transparent charity
donation system.
Key components identified include:
• Smart contract logic to accept and manage ETH donations
• Role-based access (donors and contract owner)
• Real-time contract balance viewing
• Secure withdrawal mechanisms for the owner
• Transparency through public blockchain explorers.
A system architecture is designed that includes a smart contract backend
deployed on the Ethereum blockchain and a browser-based frontend for
donor interaction.
2. Smart Contract Development The smart contract is developed using
Solidity, the standard programming language for Ethereum. Key
functions implemented in the contract include:
• Accepting ETH donations
• Tracking individual donor contributions using mappings
• Restricting withdrawal functionality to the contract owner
• Providing real-time contract balance
• Logging events for transparency and future upgrades.
The contract is tested and debugged using Remix IDE and deployed to
the Sepolia testnet.
3. Deployment and Testing After development, the smart contract is
deployed on the Sepolia Ethereum test network using Remix IDE and
MetaMask. The following tests are conducted:
• Functionality tests for donate and withdraw functions
• Interaction testing between MetaMask and Web3.js
• Visibility of transactions on Sepolia Etherscan
• Security testing to prevent unauthorized access and ensure fund
integrity.
4. Front-End Development A simple and intuitive user interface is
developed using HTML, CSS, and JavaScript, allowing users to:
• Connect their MetaMask wallet
• Send ETH donations to the smart contract
• View real-time contract balance
• Understand the process of decentralized fundraising.
The frontend communicates with the smart contract via Web3.js,
enabling seamless interaction with Ethereum through the browser.
5. Evaluation and Use Case Simulation The smart contract and interface
are evaluated through simulations of real-world charity scenarios such as:
• Fundraising for disaster relief
• Transparent school fund contributions
• Community development initiatives.
Metrics for evaluation include transaction cost (gas), ease of user
interaction, responsiveness of the contract, and transparency of fund flow.
Feedback is used to refine user interface elements and security logic.
EXISTING SYSTEM
Current systems used by charities typically involve centralized platforms such
as fundraising websites, banks, or third-party payment gateways. These
platforms are often responsible for collecting, storing, and distributing the funds
on behalf of the donors and charitable organizations. However, the lack of
transparency in how the funds are managed can be a major drawback. Donors
usually have little to no visibility into how their contributions are used after
donation. Moreover, these systems may charge service fees, impose transaction
limits, or delay the transfer of funds. In some cases, there is a risk of
mismanagement, corruption, or operational inefficiency, which further
undermines donor confidence. Fraudulent donation websites have also emerged,
exploiting the absence of a reliable verification system. The current model
largely depends on trust in centralized authorities, which is not always justified
or sufficient. The lack of automation, real-time feedback, and proof of fund
usage creates a gap between donors and beneficiaries. Hence, a more secure,
transparent, and efficient system is required to enhance the trust and
effectiveness of digital fundraising.

PROPOSED SYSTEM
The proposed blockchain-based charity donation platform removes the need for
intermediaries and ensures fund transparency by leveraging the capabilities of
Ethereum smart contracts. All donations are processed through a decentralized
and immutable system, where each transaction is recorded on the blockchain
and accessible via public explorers like Sepolia Etherscan. The system is
designed such that donors send ETH directly to a smart contract, which acts as a
digital vault. This contract is programmed to only allow withdrawals by a
predefined owner address, ensuring that only authorized individuals (typically a
verified charity administrator) can access the funds. Because all contract
interactions are recorded on-chain, donors can verify when and how funds are
being used, significantly improving transparency and trust. The frontend of the
platform is built using HTML and JavaScript with Web3.js, which connects to
the user's MetaMask wallet. This allows seamless wallet interaction from the
browser and eliminates the need for third-party logins or bank integrations.
Users can view the current balance of the contract, make donations, and interact
with other features without any blockchain expertise. This system serves as a
model for transparent fundraising and can be scaled or adapted for various
causes, such as disaster relief, education, and medical aid.
SOFTWARE AND HARDWARE REQUIREMENTS

Software Requirements

1. Operating System:

o Windows 10/11, macOS, or any Linux distribution (Ubuntu


recommended)

2. Ethereum Development Tools:

o Remix IDE (Web-based IDE for writing and testing smart


contracts)

3. Smart Contract Language:

o Solidity (for writing Ethereum smart contracts)

4. Blockchain Network:

o Ethereum Testnets (Sepolia)

5. Web Development Tools:

o Node.js (for running development tools and scripts)

o React.js (for building the front-end user interface)

o MetaMask (browser extension wallet for interacting with the


blockchain)

Hardware Requirements

1. Processor:

o Minimum: Intel i3 / AMD Ryzen 3

o Recommended: Intel i5 or higher / AMD Ryzen 5 or higher


2. RAM:

o Minimum: 4 GB

o Recommended: 8 GB or higher

3. Storage:

o Minimum: 10 GB free space

o Recommended: SSD with at least 20 GB free for smooth


development

4. Internet Connection:

o Required for interacting with blockchain networks, downloading


dependencies, and using web-based tools

Libraries:

Smart Contract Development:

 solc (Solidity compiler)

 hardhat or truffle (Ethereum development frameworks)

Blockchain Interaction:

 web3.js or ethers.js (JavaScript libraries for blockchain communication)

Front-End Development:

 React (JavaScript UI library)

 Bootstrap or Tailwind CSS (optional, for UI styling)

 axios or fetch (for handling API requests, if needed)

Testing Tools:

 chai, mocha, hardhat-waffle (for smart contract unit testing)


Wallet Integration:

 @metamask/detect-provider (to detect MetaMask in the browser)

WORKFLOW ARCHITECTURE:

PROJECT DESCRIPTION:

Create and Deploy your Smart Contract

Smart Contract Deployment Using Remix IDE

Instead of using Hardhat and Alchemy, the smart contract for the Charity
Donation System was developed and deployed using Remix, a browser-based
IDE for writing, compiling, and deploying Ethereum smart contracts.

1. Write the Smart Contract:

The smart contract was written in Solidity and includes functionalities such as
accepting donations, storing donor details, allowing only the owner to withdraw
funds, and checking the current balance.

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


contract Charity {

address public owner;

mapping(address => uint) public donations;

constructor() {

owner = msg.sender; }

function donate() public payable {

require(msg.value > 0, "Must send some ether");

donations[msg.sender] += msg.value; }

function withdraw() public {

require(msg.sender == owner, "Only owner can withdraw");

payable(owner).transfer(address(this).balance); }

function getBalance() public view returns (uint) {

return address(this).balance;}}

2. Compile the Contract:

Using the Solidity Compiler plugin in Remix, the contract was compiled with
the compiler version set to 0.8.0, matching the pragma statement in the code.

3. Deploy the Contract:

 The Injected Provider - MetaMask environment was selected in Remix to


deploy the contract.
 The contract was deployed to the Sepolia test network using MetaMask.
 Test ETH was obtained from a Sepolia faucet to fund the contract and
simulate real transactions
4. Interact with the Contract:

Post deployment, the following functionalities were tested:

 Donating ETH: Any user could send ETH to the contract using the
donate() function.
 Balance Checking: The getBalance() function allowed anyone to view the
total ETH stored.
 Withdrawal: Only the contract deployer (owner) could withdraw all funds
using the withdraw() function.

Front-End Integration Using HTML and Web3.js

To enhance user interaction and simulate real-world usability, a simple web


interface was built using HTML, CSS, and Web3.js. This front-end allows
users to donate Ether, view the contract balance, and lets the contract owner
withdraw funds, all from a browser integrated with MetaMask.
Key Features of the Web Interface:

 Connect Wallet: Users can connect their MetaMask wallet by clicking


the "Connect Wallet" button. The connected Ethereum address is
displayed on the screen.
 Display Contract Balance: Real-time Ether balance stored in the
contract is shown using the getBalance() function.
 Donate Ether: Users can input the amount they wish to donate and
execute the donate() function of the contract.
 Withdraw Funds (Owner Only): The deployer (owner) of the contract
can withdraw all the Ether from the contract using the withdraw()
function. If a non-owner tries, an error is shown.

Technologies Used:
 HTML/CSS: For the layout and styling of the interface.
 JavaScript: For adding interactivity and handling blockchain operations.
 Web3.js (v1.7.5): Used to connect the front-end with the Ethereum smart
contract and interact via MetaMask.

Code Summary:

1. Connect MetaMask Wallet

web3 = new Web3(window.ethereum);

await window.ethereum.request({ method: 'eth_requestAccounts' });

2. Donate ETH

await contract.methods.donate().send({

from: account,

value: web3.utils.toWei(amountEth, "ether")

});

3. Check Contract Balance

const balanceWei = await contract.methods.getBalance().call();

const balanceEth = web3.utils.fromWei(balanceWei, "ether");

4. Withdraw Funds (by Owner)

await contract.methods.withdraw().send({ from: account });

User Flow:

1. Open the HTML page in a browser with MetaMask installed.


2. Connect the wallet to the Sepolia test network.
3. Donate ETH to the contract.
4. Check updated balance.
5. If logged in as the contract owner, withdraw funds.

TECHNOLOGY STACK:

Programming Language: Python,Solidity,JavaScript

Packages Used:

 Solidity – Smart contract


 JavaScript + Web3.js – Frontend logic
 HTML/CSS – Frontend structure
 MetaMask – Wallet interface
 Remix IDE – Smart contract IDE

CONCLUSION
The implementation of an Ethereum-based smart contract for automated
payments demonstrates the potential of blockchain technology to revolutionize
traditional financial systems. By eliminating the need for intermediaries and
enabling trustless, conditional transactions, the solution enhances efficiency,
transparency, and security in payment processing. Smart contracts, once
deployed, execute autonomously based on predefined rules, ensuring accurate
and timely disbursement of funds without manual intervention. Through the
integration of Python for backend scripting, Solidity for contract development,
and JavaScript frameworks for user interaction, the system showcases a robust
full-stack approach to decentralized application development. Testing on
Ethereum testnets such as Goerli or Sepolia confirms the feasibility and
performance of the proposed system under real-world conditions. Ultimately,
this project highlights how blockchain can streamline recurring and conditional
payments, reduce operational costs, and pave the way for more transparent and
automated financial ecosystems.

You might also like