All Projects β†’ ankitkataria β†’ Lottery-DApp

ankitkataria / Lottery-DApp

Licence: other
πŸ’° A block-chain based Lottery System

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Lottery-DApp

svelte-box
A truffle box for svelte
Stars: ✭ 60 (+76.47%)
Mutual labels:  truffle-framework
Ethereumbook
Mastering Ethereum, by Andreas M. Antonopoulos, Gavin Wood
Stars: ✭ 11,663 (+34202.94%)
Mutual labels:  truffle-framework
Aave-FlashLoan-using-solidity
This contains all the code to execute a successful flash-loan on the Kovan test-net of Ethereum. Flash-loan will be taken from the aave lending pool where will will take 1 DAI as a flash-loan, please keep in mind that you can take very huge flash-loans but make sure you have topped-up enough DAI in to your smart contract i.e. in this instance to…
Stars: ✭ 32 (-5.88%)
Mutual labels:  truffle-framework
CrowdBank
βš™οΈ Peer to Peer Loan System implemented on Ethereum Smart Contracts
Stars: ✭ 88 (+158.82%)
Mutual labels:  truffle-framework
truffle-react
βš›οΈ A boilerplate Truffle Box project with Create React App for rapid Ethereum Dapp development
Stars: ✭ 45 (+32.35%)
Mutual labels:  truffle-framework
ECoupon-on-blockchain
HKUST university research. Supervised by prof. HUI Pan and Dr. Dimitris Chatzopoulos.
Stars: ✭ 19 (-44.12%)
Mutual labels:  truffle-framework
etherbrite
πŸ—“ Clone eventbrite on Ethereum, built in Solidity, TruffleJS, Web3js and React/Redux.
Stars: ✭ 19 (-44.12%)
Mutual labels:  truffle-framework
ehr-blockchain
Electronic Health Record (EHR) and Electronic Medical Record (EMR) systems. However, they still face some issues regarding the security of medical records, user ownership of data, data integrity etc. The solution to these issues could be the use of a novel technology, i.e., Blockchain. This technology offers to provide a secure, temper-proof pl…
Stars: ✭ 41 (+20.59%)
Mutual labels:  truffle-framework
solidity-contracts
πŸ“¦ Resources for the Ethereum Smart Contract Development tutorial series.
Stars: ✭ 64 (+88.24%)
Mutual labels:  truffle-framework
Marketplace dapp
Decentralized marketplace application built on the Ethereum Blockchain using the Truffle Framework
Stars: ✭ 16 (-52.94%)
Mutual labels:  truffle-framework
townhall
Deprecated: An early version of the Menlo framework
Stars: ✭ 21 (-38.24%)
Mutual labels:  truffle-framework

Lottery DApp

A block-chain based Lottery System made using Truffle

Features

  • The owner of the Lottery contract sets a SHA3 hash of the winning guess between 1 and 1'000'000

  • In order to participate a user sends required amount in ETH to the contract and gets 1 participation token per ETH in return

  • The users makes guess using the makeGuess() function of the contract, 1 token is deducted for each guess

  • The Lottery contract has a closeGame() function that the owner can invoke to stop any further guessing

  • The unused tokens are not reimbursed

  • A function winnerAddress() returns the address of the winner once the game is closed

  • Once the game is closed the winner can call getPrice() to collect 50% of the ETH in the contract

  • The getPrice() function sends the remaining 50% of ETH to the owner of the contract

  • The owner receives all the money that contract holds if there are no correct guesses

Setup

  • Clone repo: git clone [email protected]:ankitkataria/Lottery-DApp.git

  • Change directory to cloned copy and run: npm install

  • Install truffle: npm install -g truffle

  • Download Ganache AppImage

  • Run ganache AppImage

ganache

  • Set the winning guess in migrations/2_add_lottery_contract.js

  • Compile truffle contracts: truffle compile

  • Migrate truffle contract to blockchain: truffle migrate

  • Run server: npm run dev

  • Open http://localhost:8080 in browser

dashboard1

dashboard2

Todo

  • Add current lottery state to local storage
  • Add functionality to reimburse tokens once game is closed

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].