Skip to content

atomniketh/Grants-Management

 
 

Repository files navigation

Title: Blockchain Dev Bootcamp Final Project

Student: Christopher Stone

Table of Contents

1. Project Description

Project Name: Grant Delivery Workflow

Summary: This project will allow a Contracting Officer (CO) to award a "grant" to a Company. The Company Point of Contact (CPOC) can accept the grant award and submit a monthly report during the period of the grant. The CO reviews the monthly report, and authorizes that month's payment for the work performed.

Steps:

  1. CO awards grant with:
  • Company Name
  • Title and Description of contract
  • Total funding
  • Number of Months
  • CLINs and Quantity
  1. CO funds smart contract with award value.

  2. Company POC receives award notice.

  3. CPOC counter signs the contract award to accept.

  4. CO countersigns to fully execute the contract.

  5. CPOC delivers a MS Word Document. (via IPFS?)

  6. CO reviews MS Word doc for acceptance.

  7. Upon acceptance, (Total funding/number of months) funding is released to Company wallet address from smart contract.

Additional ideas:

  • Independently, an auditor can go to a web page to verify all contract info and TXs.
  • Make the Grant Award an NFT? Or create a NFT at grant completion?

2. Detailed Project Information

  • Avoiding Common Attacks can be found here.

  • Design Pattern Decisions can be found here.

  • Deployed address can be found here.

3. Directory Structure

The dApp and its supporting HTML/CSS/JS files are in the folder "/GrantDapp/"

The solidity code and supporting files are in the folder "/GrantMgmt/"

4. Frontend Access

The frontend was developed in HTML/CSS/JS.

This demo is hosted at: GitHub Pages

(ETH, ERC-20s, and Bored Ape Yacht Club NFTs are also accepted.)

5. Installing Dependencies

Run the following commands to install dependencies needed for this project:

Install MetaMask in your browser (Chrome/Brave/Opera/Edge). Browser specific download instructions are available at MetaMask.io

Install Node.js. Operating specific instructions are available at Nodejs.org

Then install each of the following:

npm install -g npm
npm install -g solc@0.8.10
npm install @openzeppelin/contracts
npm install -g truffle
npm install -g ganache-cli
npm install --save-dev @truffle/hdwallet-provider
npm install bip39 dotenv --save

6. Accessing the Project

The Smart Contract is deployed to the Ropsten network at: '0x908E949F7795225c772e9cd61B44cA8CD492C9ca'

7. Unit Testing

The unit tests are contained in the file at: GrantMgmt/test/grant_manager.js.

Ensure the file 'truffle-config.js' has the following settings to set the port to 7545:

  networks: {
    development: {
     host: "127.0.0.1",     // Localhost (default: none)
     port: 7545,            // Standard Ethereum port (default: none)
     network_id: "*",       // Any network (default: none)
    },
 ...

Also, because I have locked the Pragma at 0.8.10 to ensure that contracts do not accidentally get deployed using, for example, the latest compiler which may have higher risks of undiscovered bugs.

Ensure the file 'truffle-config.js' has the following settings to set the Solidity compiler to 0.8.10:

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.10",    // Fetch exact version from solc-bin 
    }
  },

Spin up an instance of Ganache and select "New Workspace (Ethereum)."

Click "Add Project" and select the truffle-config.js file from the GrantMgmt folder. Then select "Save Workspace" to start the local host.

To run all tests, simply run:

truffle test

8. Screencast of Project Walk Through

Here is the link to a screencast of me walking through the project.

Releases

No releases published

Packages

No packages published

Languages

  • HTML 84.4%
  • JavaScript 12.4%
  • Solidity 1.9%
  • CSS 1.3%