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.
- Node.js
- NPM (Node Package Manager) or yarn
- Hardhat
- Clone the repository:
git clone https://github.com/leonnloo/Ruffle-Lottery-Smart-Contract
- Navigate to the project directory:
cd Ruffle-Lottery-Smart-Contract
- Install npm dependencies using package.json
Compile the smart contracts using Hardhat:
npx hardhat compile
Deploy the contracts to the local blockchain:
npx hardhat run scripts/deploy.js
Execute the test cases:
npx hardhat test
- Get SubId for Chainlink VRF & Fund at vrf.chain.link
- Deploy contract using the the SubId
- Register the contract with Chainlink VRF & it's SubId
- Register the contract with Chainlink Automation
- Run Staging test
Contributions are welcome! Please feel free to submit a pull request or open an issue for bugs, features, or improvements.
This project is licensed under the MIT License - see the LICENSE file for details.
- 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.