Skip to content

Yashkrit-Singh/hardhat_Project_ChaiDapp

Repository files navigation

Blockchain DApp Project - Buy Me a Chai

This project is a decentralized application (DApp) where users can "buy chai" by sending a small amount of cryptocurrency (ETH) along with a message. This DApp showcases a simple way to send Ethereum transactions and messages on the blockchain.

Table of Contents

Features

  • Users can send ETH to "buy chai" and leave a message.
  • Each transaction is stored on the blockchain.
  • Displays a list of recent messages and chai purchases.
  • Shows the account of the user making the transaction.

Technologies Used

  • Solidity: For writing the smart contract.
  • React: For the frontend interface.
  • Ethers.js: To interact with the Ethereum blockchain from the frontend.
  • Hardhat: For smart contract development and deployment.
  • Metamask: Wallet integration for Ethereum transactions.

Getting Started

Prerequisites

Installation

  1. Clone the repository:
    git clone https://github.com/Yashkrit-Singh/hardhat_Project_ChaiDapp.git
    cd your-repo-name
    
  2. Install dependencies:
    npm install
    
  3. Navigate to the client folder and install dependencies for the frontend:
    cd client
    npm install
    

Running the DApp

  1. Start the Hardhat Node:

    npx hardhat node
    
  2. Deploy the Contract:

    • In a new terminal, deploy the contract on the local Hardhat network:

        npx hardhat run scripts/deploy.js --network localhost
      
    • To deploy the contract to a testnet (like Sepolia), update the hardhat.config.cjs file with your API keys and deploy it:

        npx hardhat run scripts/deploy.js --network sepolia
      
  3. Run the Frontend:

    cd client
    npm start
    
    

Usage

  • Connect Wallet: Open the DApp and connect your Metamask wallet.
  • Buy Chai: Enter your name, message, and click "Pay" to send ETH along with your message.
  • View Memos: All messages and transactions are displayed in the "Memos" section.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published