Code Monkey home page Code Monkey logo

blood-bank-blockchain's Introduction

Blood-Bank-BlockChain

blockchain blood bank management system This is a smart contract for a Blood Bank Management System implemented on the Ethereum blockchain. The system allows users to register as donors, patients, and hospitals, facilitating the donation and request of blood.

Smart Contract Overview

Admin Functions adminLogin(): Allows the admin to log in. grantDonorPermission(address donorAddress): Grants permission to a donor. grantPatientPermission(address patientAddress): Grants permission to a patient.

Donor Functions registerAsDonor(string memory name, BloodType bloodType): Registers a donor. donateBlood(BloodType bloodType, uint amount): Allows a donor to donate blood. getTotalBloodDonated(): Gets the total amount of blood donated. getBloodInventory(BloodType bloodType): Gets the blood inventory for a specific blood type.

Patient Functions registerAsPatient(string memory name, BloodType bloodType): Registers a patient. requestBlood(BloodType bloodType, uint amount): Allows a patient to request blood. getPatientRequests(address patientAddress, BloodType bloodType): Gets a patient's blood donation requests.

Common Functions getRegisteredUsers(): Gets the addresses of registered donors and patients.

Readme Instructions

Smart Contract Deployment: Deploy the smart contract on the Ethereum blockchain. The deployer becomes the admin.

Admin Login: Call the adminLogin function to log in as the admin. User Registration: Donors and patients can register using registerAsDonor and registerAsPatient, respectively.

Permissions: Admin can grant and revoke permissions for donors and patients.

Blood Donation: Donors can donate blood using the donateBlood function.

Blood Request: Patients can request blood using the requestBlood function.

Data Retrieval: Retrieve information on registered users, total blood donated, and blood inventory using appropriate functions.

Events: The contract emits events for various actions. Monitor these events for system activity.

Web Interface: Develop a user-friendly web interface to interact with the smart contract. Use web3.js or a similar library for frontend-backend interaction. Styling:

Customize the provided HTML and CSS for a visually appealing and user-friendly experience.

blood-bank-blockchain's People

Contributors

daddie-b avatar danchuanyu avatar coolestnick avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.