Raffle Smart Contract

๐Ÿ“– Overview

This repository serves as a practical demonstration of utilizing the Hardhat framework and Chainlink automation for Ethereum smart contract development. Inspired by the Solidity, Blockchain, and Smart Contract Course โ€“ Beginner to Expert Python Tutorial by Patrick Collins from freeCodeCamp, project is structured to provide a hands-on experience in building, compiling, deploying, and testing Solidity smart contracts. It utilizes chainlink automation to randomly select a winner among those users that register into the raffle with 0.1 eth participation fee.

๐Ÿš€ Getting Started

๐Ÿ” Prerequisites

  • Node.js
  • NPM (Node Package Manager) or yarn
  • Hardhat

๐Ÿ›  Installation

  1. Clone the repository:
    git clone https://github.com/leonnloo/Ruffle-Lottery-Smart-Contract
  2. Navigate to the project directory:
    cd Ruffle-Lottery-Smart-Contract
  3. Install npm dependencies using package.json

๐Ÿ“ Compile Contracts

Compile the smart contracts using Hardhat:

npx hardhat compile

๐ŸŒ Deploy Contracts

Deploy the contracts to the local blockchain:

npx hardhat run scripts/deploy.js

๐Ÿงช Run Tests

Execute the test cases:

npx hardhat test

๐Ÿ›œ Staging test

  1. Get SubId for Chainlink VRF & Fund at vrf.chain.link
  2. Deploy contract using the the SubId
  3. Register the contract with Chainlink VRF & it's SubId
  4. Register the contract with Chainlink Automation
  5. Run Staging test

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for bugs, features, or improvements.

๐Ÿ“„ License

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

๐Ÿ™Œ Acknowledgments

  • Inspired by Patrick Collins and freeCodeCamp's comprehensive Solidity and Blockchain course.
  • Thanks to the Hardhat team for providing a robust framework for Ethereum development.