Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Donation Platform dApp where you can track how charities use your donation

License

Notifications You must be signed in to change notification settings

software-assignments-spring2021/spring-2019-Laika

Repository files navigation

Build Status Laika

Laika: A Crowd Donation Project

homePage

Web GUI

Overview

Crowd Donation Platform where all your donations to a charity will be tracked so you know how you money was spent exactly.

A solution for transparency

Lack of transparency in charitable donations has deterred many from making a donation and organization from being held accountable for their actions. We want to help increase transparency to encourage more donation and bring charities closer to achieving their missions.

Laika Crowd Funding, strives to become a powerful platform where approved 503c organizations can sign up to receive funds using crypto and a blockchain – anyone with a computer can help raise funds with full transparency. Currently, there are some websites which users can mine “Monero” for a good cause. However, the lack of transparency of “Monero” leaves donors wondering where their contributions actually go.

Our system uses Ethereum Blockchain, guaranteeing confidence in the donation as all transactions are public. Users select from a list of verified donors and they can donate Laicoins to them. The 503c charity will receive the funds and spend them on a market place within the platform. All purchases are public and the user can track where every coin was spent on. With this straightforward platform we hope to increase the willingness to donate and leave users with a peace of mind.

In the future we hope to make our coin web browser mineable, so anyone can just leave a tab open to donate to their favorite charity, facilitating the process and encouraging more people to become generous. We also hope that in the future when all goods and services will be tokenized digitally, we will be able to trace how charities spend their donations even ourside of our marketplace.

Please read REQUIREMENTS.md for a better understanding of project details.

Getting Started

Prerequisites

  • Node.js: Download
  • Truffle Framework: npm install -g truffle
  • Solidity: npm install -g solc
  • Ganache: Download
  • React: npm install -g create-react-app
  • Web3.js: npm install web3
  • MongoDB: Download
  • IPFS: Download

Installing

  1. Install latest version of Node.js for your OS here: Download
  • Verify installation with: node -v; npm -v
  1. Install Ganache: Download
  • Create a new workspace in Ganache (procede without changing anything in the settings!)
  1. Install MongoDB: Download

  2. Install IPFS: Download

  • Follow instructions in a section below for how to use
  1. Install Metmask for your browser: Download
  • Register by clicking on fox icon in browser, and following instructions
  • Make sure to save Seed Phrase!
  • Once Done, click on the drop down meny and select Custom RPC, add a network name and, with Ganache running, add http://localhost:7545 to the RPC URL to test locally. To switch to one of the accounts provided by Ganache, first copy the private key of an account in Ganache - you can find this by clicking the key icon next to each account number. Then, in MetaMask, click on your account icon next to the network name and click to import account. Paste the private key you copied from Ganache into the private key field in MetaMask, and complete the import.
  • Or, if you prefer to use the Rinkeby test network rather than Ganche, click on the drop down menu at the top and change from Ethereum Main Network to Rinkeby Test Network (otherwise you may spend real money and lose it if you have ether!) if you would like to use the contracts on Rinkeby
  1. If using the Rinkeby Test Network, in order to have ether on that network go to: Download
  • Follow the instructions, which include making a social media post on a platform like facebook or twitter with your ethereum wallet address (this can be found in MetaMask if you click on the hash number below your profile and above your balance).
  1. Globally install the following packages: truffle, solc (solidity programming language), create-react-app, web3

  2. Clone the repository from our github to your local machine: https://github.com/nyu-software-engineering/Laika

  3. To deploy the contracts (they are also deployed to the Rinkeby Test Net, and this can be seen from below instructions):

  • Open Ganache

  • npm install

  • truffle develop

  • compile

  • migrate

  • test (if you wish to run the smart contract tests)

  1. For the front end:
  • cd src
  • npm install
  • npm run dev

Running the tests

Running Smart Contract tests

Make sure both Truffle and Ganache are installed!

  1. Open Ganache
  2. From command line: truffle compile
  3. From command line: truffle test

Deployment

  • truffle develop

  • compile

  • migrate

  • cd src

  • npm run dev

Trouble shooting

  • If Meta Mask is not popping up
  • First of all, make sure you don't have any other node than Ganache running in the background, no private node, no other Geth.
  • Go to the directory of your truffle project and delete the build directory of that directory.
  • Open a fresh Ganache instance and in your terminal truffle migrate --reset --compile-all in your truffle project directory.
  • In your browser open Metamask, switch your network to the Main Ethereum Network and then switch back to your private network where your Ganache is running.
  • Then just to be safe completely quit and restart the browser, open your Metamask with your password, check if you are still on your private network, and everything should be fixed!

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

Acknowledgments

Demo

Below will all be Demos of our smart contract in action

See deployed Smart Contracts

You can go to deployment.md to find all the smart contracts deployed to Rinkeby testnet. Links to the Smart Contracts and transactions deploying the contracts are included.

Check Laikoin Balance

Open Remix, click run on the top right corner, then copy and paste the contract address you want to use next to "At Address" button. After you click "At Adress", click Deployed Contracts and you will be able to see a list of functions you can call. Then choose balanceOf and enter your public address. The output will be displayed in the middle section of Remix.

Send Laikoin from one address to another

Choose transfer function and enter the public address you want to send Laikoin to, and how much. Make sure you enter Rinkeby Address! Any public address at other network will result in permanent loss!!

Check the balance of recipient (the Recipient started with balance of 1)

The recipient in this case is using My Ether Wallet instead of Metamask for demo purposes. You can sign in to your MEW account, and copy and paste the contract address as well as ABI of Laikoin smart contract to interact with it.

Register a product on Market Smart Contract

Choose registerProduct function under Deployed Contracts. Enter a number for ID, and make sure the ID is not already used. Price is also a number. For name and description, it must be in hexadecimal so use a converter and make sure to add "0x" at the front. When you click the function, a Metamask transction should be triggered.

See registered product

To view the details of a registered product choose getProductInfo function and enter the product ID. Name and description returned are in hexadecimal, so remove "0x" at beggining then use a converter to view data.

Buy a product

To buy a product, choose buyProduct function, and enter the ID of the prodct you want to buy. A Metamask transaction should be triggered.

IPFS usage

Note: This will only work after installing IPFS!

To put something on IPFS add the folder/documents/files/etc like so and get the hash ID (the -r flag is for recursive)

Initialize the IPFS daemon, this step is necessary to connect to IPFS hashes at http://127.0.0.1:8080/ipfs/

With daemon running, connect to the hash ID (either one provided to you, or one from adding to IPFS like the first gif)

If you would like to publish your hash so it can be accessed with an IPFS daemon, run the following command This may take a while

Once it is published and you have the public hash id connect to https://ipfs.io/ipns/, where hash is the public hash ID given to you after running the previous command

Our entire code repository as of May 9th, 2019 at 12:54pm is published on ipfs at http://127.0.0.1:8080/ipfs/QmRwBntNNQwbiBau5keRWpE2x8jbLLxcqxS8zD2FGQSxKo

Remember you need ipfs daemon running in order to connect to this hash!