Git Product home page Git Product logo

extracaterpiller / decentralized-lottery Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 207 KB

The Decentralized Lottery Application is a blockchain-based raffle system where users can participate by paying an entry fee in ETH. The application leverages Chainlink VRF for fair and random winner selection, ensuring transparency and trustworthiness. It is built with nextjs, solidity and hardhat

License: MIT License

Solidity 30.44% JavaScript 66.68% CSS 2.87%
chainlink hardhat lottery nextjs solidity blockchain

decentralized-lottery's Introduction

Decentralized Lottery Application

This repository contains the code for a decentralized lottery application built with Solidity, Hardhat, Chainlink VRF and a Next.js frontend. The application allows users to enter a raffle by paying a specified entrance fee. A winner is selected randomly at regular intervals using Chainlink VRF to ensure fairness.

Table of Contents

Introduction

The Decentralized Lottery Application is an automated raffle system where users can participate by paying an entry fee. The smart contract, written in Solidity, handles the logic for entering the raffle, selecting a random winner using Chainlink VRF and distributing the prize. The frontend, built with Next.js, provides an interface for users to interact with the raffle.

Features

  • Decentralized and transparent lottery system
  • Fair winner selection using Chainlink VRF
  • Automated processes with Chainlink Automation
  • User-friendly interface built with Next.js
  • Secure and efficient contract design

Technologies Used

  • Solidity: Smart contract programming language
  • Hardhat: Ethereum development environment
  • Chainlink VRF: Verifiable random function for fair randomness
  • Next.js: React framework for building the frontend
  • Ethers.js: Library for interacting with the Ethereum blockchain

Smart Contract

The smart contract is located in the contracts directory. It is implemented using Solidity and Hardhat.

Key Components

  • Raffle Contract: The main contract that handles the raffle logic.
  • Chainlink VRF Integration: Ensures fair and random winner selection.
  • Automation: Utilizes Chainlink Automation for periodic winner selection.

Frontend

The frontend is built using Next.js and is located in the frontend directory.

Key Components

  • Homepage: Allows users to enter the raffle, view current number of participant and last winner
  • Winner Announcement: Displays the recent winner of the raffle.
  • User Interaction: Provides a seamless interface for interacting with the smart contract.

Installation

Prerequisites

  • Node.js
  • npm or yarn

Clone the Repository

git clone https://github.com/ExtraCaterpiller/Decentralized-Lottery
cd decentralized-lottery

Install Dependencies

Smart Contract

cd LotteryHardhat
npm install

Frontend

open a new terminal and execute the following:

cd lotteryfrontend
npm install

Usage

Deploy Smart Contract

  1. Configure your environment variables in .env.
  2. Deploy the contract using Hardhat
npx hardhat deploy --network <your-network>

Run the Frontend

  1. start the Next.js development server:
npm run dev
  1. Open your browser and navigate to http://localhost:3000

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

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

decentralized-lottery's People

Contributors

extracaterpiller avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.