Skip to content

This is a proof-of-concept smart contracts built using solidity to show the automation on study loan/scholarship disbursement using blockchain. (Ganache version)

License

Notifications You must be signed in to change notification settings

shyan179/ScholarshipDisbursement

Repository files navigation

ScholarshipDisbursement

Overview

This is a proof-of-concept smart contracts built using solidity to show the automation on study loan/scholarship disbursement using blockchain. The smart contract is separated into 3 parts, student, loan/scholarship provider and university staff. A decentralised web application (dApp) has been created using ethers.js to connect with the smart contracts and metamask. The dApp allows higher education staff, loan/scholarship institutions and students to interact with the private Ethereum network and transfer the money disbursement automatically once the disbursement requirements are met.

Wallet used

I am using web wallet - Metamask for this project. For this particular project version, I am using Ganache for the deployment and testing. There are 2 more versions using different testnets in other repository folders (Rinkeby and Goerli).

For more information

  1. Metamask refer to this link: https://metamask.io/
  2. Ganache refer to this link: https://trufflesuite.com/ganache/

Solidity contracts

There are 3 smart contracts on this project and all of them are deployed using ganache via Remix IDE, you can use the "ScholarshipDisbursement.sol" if you want to deploy the solidity contratcs to different blockchain via remix IDE. Or you can use the addresses below on remix IDE to look at the functions.

  1. Student Smart Contract Addrress:
0x933d60E5F1AEff1f37Dd5792Db0cd2E0fd9157d1
  1. Scholarship Provider Smart Contract Addrress:
0x967B23d6e0DD4170ecAeA46c1Fe92D94B11F1016
  1. University Staff Smart Contract Addrress:
0xfBf63710005a304556802b4bffC018585E041cf1

Run the front end in local node

Visual Studio Code

I use Visual Studio Code to create and edit my project. You need also need Visual Studio Code to run the local web server. You can find the latest version here: https://code.visualstudio.com/

Then download all the files in this repository and put them into a single folder in your local drive. Remember to unzip any zip file.

Open the folder using visual studio code.

Node.js and NPM (Node Package Manager)

You need to have Node.js and NPM, which come together.

NB: Check if Node and NPM are already installed by inputting the following commands in the terminal:

node --version
npm --version

If they are installed, you will see something like this

image

Else go to https://nodejs.org/en/ if you need to install it.

Running the local server

To execute the local web server. Type the below in the terminal:

node server.js

image

In your browser, go to the link below to access the frontend

http://localhost:3300

If the local web server is set up correctly, you will see the landing page below

image

Each of the button in the landing page give you accesss as if to 3 different parties (Student, Scholarship Provider and University Staff)

Student Page

Student Page allows the student to enter their student code (numeric only) and their details. The smart contract will store the wallet ID to the student record when execute the transaction, this will be used later on the scholarship payment to pay student directly to their wallet.

Error message will show if try to store a student code that already exists in the blockchain

image

Scholarship Provider Page

Scholarship Provider Page allows the scholarship provider to add scholarship to the student. If the provider tries to add scholarship to the student code that is not exists in the blockchain, it will create an error message.

When the provider add the scholarship, the wallet address of the provider will be stored to the scholarship record and metamask will be executed to transfer the amount sponsored in Wei (because ganache has no chainlink to convert the currency, I use Wei here as the amount unit, you can refer the Rinkeby version for GBP as the amount unit or Goerli version for USD in other repository folders) to the Staff smart contract for disbursement later.

image

The provider can also cancel the scholarship if they decide not to sponsor by using the cancel scholarship function. The amount will not be return immediately to the provider, instead the university staff will need to process the refund.

image

University Staff Page

University Staff Page allows the staff to enter the attendance percentage and average result of the student, if the attendance and result meet the required percentage entered by the provider when add the scholarship, the student will be disbursed the scholarship amount directly to their wallet address. Else the scholarship will mark as failed.

image

For those scholarships that have been cancelled by provider, staff can perform the refund to refund back the money of the provider from the smart contract. The money will be send to the provider wallet.

image

For those failed scholarship due to not meeting the attendance and result criteria, staff can reactivate them to reinsert new result or attendance for the payment to be disbursed.

image

About

This is a proof-of-concept smart contracts built using solidity to show the automation on study loan/scholarship disbursement using blockchain. (Ganache version)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published