GithubHelp home page GithubHelp logo

kuaiph / ethereum-lifetime-lottery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pineappledeveloper/ethereum-lifetime-lottery

0.0 1.0 0.0 5 KB

The Lifetime Lottery is a simple decentralized peer-to-peer lottery game based on Ether.

License: MIT License

ethereum-lifetime-lottery's Introduction

Ethereum Lifetime Lottery

alt Ethereum Lifetime Lottery alt Ethereum Lifetime Lottery QR-code

The Lifetime Lottery is a simple decentralized peer-to-peer lottery game based on Ether. Every Ethereum address can join and every new submission fires a reward.

How does it work?

It's simple: you have to send 0.5 ETH (+ transaction fee) to the smart contract's address (0xCE9ed0b322A1420Da4b6990e3047796f57471336) for registering to the lottery list. After registering, the smart contract chooses randomly one winning address from the lottery list (including your address) and sends 0.4 ETH to the winner. The remaining 0.1 ETH are added to the jackpot. With a chance of 5% the contract hits the jackpot and sends it to the winning address too.

Once you are registered, you just have to wait for a new submission and for some luck.

Possible results in more detail

When you send 0.5 ETH to the contract, it adds your address to the lottery list. After that, the following results are possible:

  • Your address is the winner and you receive 0.4 ETH. The contract hits the jackpot and you receive the whole jackpot too.
  • Your address is the winner and you receive 0.4 ETH. The jackpot increases by 0.1 ETH.
  • Any other address from the list is the winner and receives 0.4 ETH. The contract hits the jackpot and sends it to the winning address too.
  • Any other address from the list is the winner and receives 0.4 ETH. The jackpot increases by 0.1 ETH.

And why 'Lifetime Lottery'?

I call it 'Lifetime Lottery', because you just have to register once and get the chance for receiving a reward (or even the jackpot) with every new submission, as long as the Ethereum Blockchain exists!

Restrictions

  • For registering, you have to send at least 0.5 ETH to the smart contract's address (you can send more Ether, but you won't have any benefit from it - it would just increase the reward, which is immediately redirected).
  • Each address can only be registered once to the lottery list.

Getters

The Lifetime Lottery serves the following information as Getters:

  • amountOfRegisters: it shows, how many addresses are already registered.
  • currentJackpotInWei: it shows the current size of the jackpot in wei. Remember, that one Ether is equal to 10^18 wei.
  • ourLastWinner: it shows the address of the latest winner.
  • ourLastJackpotWinner: it shows the address of the latest jackpot winner.

Events

The smart contract logs several events and puts them on the Blockchain.

  • Received new funds...: this event is logged, when the contract detects a new submission.
  • We have a Winner!: this event is logged, when the contract has picked a winner.
  • Jackpot is hit!: this event is logged, when the contract hits the jackpot.
  • Failed: already joined! Sending back received ether...: this event is logged, when the contract receives a funding from an address, which has already been registered to the lottery list.
  • Failed: not enough Ether sent! Sending back received ether...: this event is logged, when the contract receives less than 0.5 ETH.

Conclusion

Register now, by sending 0.5 ETH to 0xCE9ed0b322A1420Da4b6990e3047796f57471336 for joining the Lifetime Lottery. Good luck!

ethereum-lifetime-lottery's People

Contributors

pineappledeveloper avatar

Watchers

James Cloos 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.