project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Coffee Is Humane

CoffeeIsHumane is a smart contract-based project enabling donations in coffee equivalents ($2.50 each) via ETH, USDC, or USDT. Utilizing Chainlink Oracles, it ensures accurate ETH/USD conversions.

Coffee Is Humane

Created At

ETHGlobal Brussels

Project Description

This is my first web3 project but i couldnt finish the implementetion due to time restrictions ı enjoyed my time and first hackathon experienceI I included how I will finish the project in Readme.md.

CoffeeIsHumane is an innovative project leveraging blockchain technology to facilitate charitable donations in the form of coffee equivalents. It uses smart contracts to ensure transparent and accurate transactions, allowing users to donate the equivalent cost of a cup of coffee ($2.50) using various cryptocurrencies. Here's a detailed breakdown of the project:

Overview CoffeeIsHumane allows users to donate a specified number of coffees, priced at $2.50 each, to a recipient. Donations can be made using Ether (ETH), USD Coin (USDC), or Tether (USDT). The project integrates with Chainlink Oracles to fetch real-time ETH/USD prices, ensuring accurate conversion rates for ETH donations. A Command Line Interface (CLI) app is also provided for easy interaction with the smart contract.

Smart Contract: CoffeeDonation.sol The CoffeeDonation smart contract includes several key functionalities:

donateEther: Allows users to donate ETH equivalent to the specified number of coffees. The contract uses Chainlink Oracles to fetch the current ETH/USD price to determine the correct amount of ETH to donate.

donateUSDC: Allows users to donate USDC equivalent to the specified number of coffees.

donateUSDT: Allows users to donate USDT equivalent to the specified number of coffees.

setRecipient: Allows the contract owner to set the recipient address for donations.

setCoffeePriceUSD: Allows the contract owner to set the price of a coffee in USD.

getEthPrice: Fetches the current ETH/USD price from Chainlink Oracles.

withdrawTokens: Allows the contract owner to withdraw any ERC20 tokens sent to the contract by mistake.

withdrawEther: Allows the contract owner to withdraw any Ether sent to the contract by mistake.

Events Donation: Emitted when a donation is made, including the donor's address, the amount donated, and the number of coffees. Fallback Functions receive: Handles unexpected Ether transfers. fallback: Handles unexpected calls to the contract. CLI Application The CLI application provides an easy way for users to interact with the CoffeeDonation smart contract. Here's the typical flow:

Welcome Message: Displays a welcome message to the user. Recipient's Address: Prompts the user to enter the recipient's address with a caution to verify the address carefully. Number of Coffees: Prompts the user to enter the number of coffees they wish to donate. Donation Transaction: Performs the donation transaction. Etherscan Link: Provides a link to the transaction on Etherscan for verification. Confirmation: Confirms the donation and displays a success message. Additional Donations: Asks the user if they want to make another donation or exit.Future Development Goals and Concepts Web Interface: Develop a user-friendly web interface for the donation system, allowing users to interact with the contract without using the CLI. Support for Additional Tokens: Integrate support for more ERC20 tokens for donations. Enhanced Security Features: Implement multi-signature wallets and additional security measures to safeguard donations. Analytics Dashboard: Create a dashboard to track donations, displaying metrics and statistics for transparency and accountability. Mobile Application: Develop a mobile application to enable donations on the go, providing a seamless user experience. Summary CoffeeIsHumane is a robust and transparent system designed to simplify and secure the process of making charitable donations using cryptocurrency. By leveraging smart contracts and Chainlink Oracles, it ensures accurate and reliable transactions. The project is geared towards continuous improvement, with plans to expand its features and accessibility, making it easier for users to contribute to good causes in a modern, digital economy.

How it's Made

Building the CoffeeIsHumane project involved several key technologies and steps to ensure the seamless and secure operation of the donation system. Here are the detailed steps and technologies used in the project:

Technologies Used Solidity: For writing the smart contract (CoffeeDonation.sol) that handles the donation logic. Chainlink Oracles: To fetch real-time ETH/USD prices to ensure accurate conversion rates for ETH donations. Node.js: For building the CLI application that interacts with the smart contract. Viem Library: For blockchain interactions within the Node.js environment. Inquirer Library: For building the CLI user interface and handling user inputs. Ethereum Blockchain: As the underlying blockchain for deploying and running the smart contract. ERC20 Tokens: Specifically USDC and USDT, for allowing donations in stablecoins. .env File: For securely storing sensitive information like the RPC URL and the private key.

background image mobile

Join the mailing list

Get the latest news and updates