kwight / blockchain-developer-bootcamp-final-project

MIT License
2 stars 0 forks source link

CryptoGive

CryptoGive is a platform for donating to your choice of charity programs with cryptocurrency.

Home View Donations View
Screen Shot 2021-12-01 at 8 16 50 PM Screen Shot 2021-12-01 at 8 18 52 PM

How does a blockchain help?

Donation platforms already exist – how is one based on a public blockchain an improvement?

How does CryptoGive work?

The platform owner can register charities, who in turn register programs/campaigns. Potential donors select from the active programs available and donate an amount in ether (which is then transferred to the address of the charity).

Owners

The owner is the address that deployed the contract. The owner can:

Charities

A charity must first be registered by the owner. A registered charity can:

Donors

Anyone can be a donor to any active program, and see their own past donations.


Project implementation

CryptoGive is a standard-configured Truffle project with few dependencies. The client app is stateless and written in vanilla JavaScript, with each page loading only the scripts it needs. Other than the contract migrations, the project does not require a build process.

It uses ethers.js and MetaMask as providers and the wallet.

The project UI is publicly available at https://blockchain-bootcamp-project.web.app/, which uses the deployed contract on the Ropsten network.

To develop the project locally, you will need Truffle v5.4.15 or higher (Truffle's own requirements are Node v8.9.4 or later, and Linux, MacOS, or Windows).

Directory structure

Installation

You're all set – you've got a console with access to the deployed contract on the local blockchain, and a front-end in your browser that's using the local blockchain as its data source.

Development

Here are some commands you can use to interact with the contract from the console. These assume you've set the f variable from the installation notes above. Remember that on the local blockchain, the contract owner is the accounts[0] account (which is the default from: value when one isn't specified). If the client UI is open while running commands on the console, it will update automatically.

Deployment

The project uses dotenv for managing keys when deploying to public networks. Create a local .env file (which is gitignored) with the following constants. Ropsten is already configured (other networks would need to be added to truffle-config.js).


Address for certification: kwight.eth (0x0808832994E697C9c1A3e76a60A7e0c75e52348a)