- Donors can donate crypto to category pools (such as R&D, Admin, Logistics, Technology, etc.) held in the smart contract.
- Charity organizations can transfer funds from the smart contract to their charity organization's address when the need arises.
- If the balance of a category pool is insufficient, then charity orgs can update need so that donors can donate to category pools accordingly. Charity orgs can also create new category pools.
- Admin can update name of an existing category pool.
Note: Effort has been made to communicate the above through the Dapp UI with descriptive text where appropriate.
Link: https://crypto-donater.vercel.app/
- Visit Crypto Donater Dapp.
- You will see an intro page. Follow the instructions. Open MetaMask and connect your account (please select Rinkeby Test Network).
- You'll be taken to the main page. Read through the descriptive text.
- Review the Category Pool Table.
- Donor: If you're a donor, you can donate by following the instructions to submit the form. A transaction will be initiated when you click 'Donate,' assuming all validations pass. Once the transaction is complete, the category pool table will update with the latest values read from the blockchain.
- Charity Organization: If you're a charity organization, you can perform the below mentioned actions. In both cases, please follow the instructions to submit the form. A transaction will be initiated when you click 'Create Category Pool' or 'Update Category Need,' assuming all validations pass. Once the transaction is complete, the category pool table will update with the latest values read from the blockchain. a. Create a new category pool. b. Update the need of an existing category pool.
- Admin: If you're the admin (the owner of the smart contract), you can update the names of the category pools. This has not yet been implemented on the UI, but it has been implemented/tested as a function in the smart contract. Used OpenZeppelin's Ownable contract.
- Charity Organization: Initiate transfer of funds from smart contract to org's address for a given category pool.
- Admin: Implement on UI the ability to update names of category pools.
- Data Feeds: Implement Chainlink's ETH/USD data feeds for real-time conversion rates. Attempted in Solidity and Web3.js, but unsuccessful.
- Blockchain: Ethereum
- Smart Contracts: Solidity
- Development Framework: Truffle
- Ethereum Gateway Service: Infura
- Dapp Framework: React Box in Truffle
- Frontend: React
- UI Components: Material-UI
- Oracles: Chainlink Data Feeds
- Libraries: OpenZeppelin Access
- Node.js >= v14
- React >=v17 (needed for material-ui)
- Truffle
- Ganache
- NPM
git clone https://github.com/knxyzkn/blockchain-developer-bootcamp-final-project
- Open a new terminal
- Navigate to the project folder
- Run
npm install
- install smart contract dependencies
- Run
truffle develop
- Truffle Develop starts at
http://127.0.0.1:8545/
- Host:
127.0.0.1
- Port:
8545
- Truffle Develop starts at
- Run
compile
- Run
migrate
- Network Name:
develop
- Network ID:
5777
or*
- Network Name:
- Run
test
to run test cases - Optional: Running smart contract functions from the terminal may not be required because all functions can be actioned from the UI, except for the Admin capability to update category pool name. If you wish to run any of these functions from the terminal, the commands to do so are given in the
CryptoDonater.sol
file. Please review the comments tagged with @dev.
- Open a new terminal
- Navigate to the project folder
- Run
cd client
- Run
npm install
- Run
npm run start
- Open
http://localhost:3000
in web browser that has MetaMask - Troubleshooting steps in case of errors:
- Refresh the dapp page
- Verify that you're connected to
localhost 8545
in MetaMask - Reset your account in MetaMask settings
- Verify that your account has sufficient funds to initiate a transaction
https://www.loom.com/share/ea8dd8f2c8cf47b4aeaa152f78dd2a0b
Account Address: 0xD88D5F94B9a10fC6AB4e29A7dB18E49b9Af64979
client
: React frontend.contracts
: Smart contracts deployed on the Rinkeby Test Network.migrations
: Migration files for deploying smart contracts.test
: Tests for smart contracts.
RINKEBY_INFURA_PROJECT_ID=
RINKEBY_MNEMONIC=