/chainlink-vrf-lottery

This project is my implementation of lottery game what relies on random numbers generated and provided by chainlink VRF. The lottery is fully customizable, the reward, minimum participation cost and time of participation phase are being set by deployer.

Primary LanguageJavaScript

Chainlink VRF Lottery Game

This project is my implementation of lottery game what relies on random numbers generated and provided by chainlink VRF.

Lottery reward is fully secured - even lottery deployer cannot withdraw it. Also, the lottery is fully customizable, the reward, minimum participation cost and time of participation phase are being set by deployer.

Disclaimer

Keep in mind, to use Chainlink VRF first you need to create subscription (then pass it in .env) and after deployment you should add consumer to subscription.

For more details, go here: Chainlink VRF docs

Features

  • Safe random number generation (not so obvious on blockchain)

  • Fully customizable (reward, minimum ticket cost, time of participation time)

  • Safe for participants - reward stays out of reach of deployer

  • Using @openzeppelin counters for safe counting participants

Created with (dependencies)

  • Truffle v5.5.11 (core: 5.5.11)
  • Ganache v^7.0.4
  • Solidity - ^0.8.0 (solc-js)
  • Node v16.14.2
  • Web3.js v1.5.3
  • dotenv ^16.0.0
  • @openzeppelin/contracts ^4.5.0

Installation

Clone the chainlink-vrf-lottery

  git clone https://github.com/kchn9/chainlink-vrf-lottery.git

Go to the project directory

  cd chainlink-vrf-lottery

Install dependencies

  npm install

Get ready to deploy - check .env.example then run

  truffle migrate --network rinkeby

Authors

License

MIT