A little fun smart contract

in #smart6 years ago (edited)

How It Works

The following smart contract reverse race works as follows:

  1. It begins with a certain balance in the smart contract.
  2. As soon as someone deposits 10% or more of the current balance, he becomes the leader.
  3. If nobody else deposits 10% or more of the current balance within 1 day, the leader can withdraw the prize (90% of the balance).
  4. If another user deposits 10% or more of the current balance within 1 day , he becomes the new leader.
  5. Once a winner is obtained because he lasted 1 day, 90% of the current balance is paid to the leader, 9% is set up as initial bounty for another race, and 1% is paid as fee to the contract owner for the original deposit (that hopefully he can recover).
  6. The winner has 3 days to withdraw the prize by simply making an (empty) ether transaction to the smart contract. If the winner does not withdraw the money within this interval of time, then anyone else can claim 10% of the prize by making an ether transaction, and the rest is saved for the next race.
  7. A new race starts immediately after another race ends.

The Owners List

Another advantage of winning a race is that you are added to the list of owners. The owners split the 1% fee charged after every race. While this may turn out to be a very tiny fee, it may provide an extra incentive to the racers. The 1% fee is split among owners and weighted by the number of times they have won a race. So for a particular address X that has won Y times, the fee formula is:

ql_7ad618514cddb0112be29fa253f8cea8_l3.png

Instructions

  • The address of the smart contract is XXXXXXXXXXXXXX.
  • To see the state of the smart contract parameters, such who is the current leader, balance, etc, you can do so at
    XXXXXXXXXXXXX
  • Just remember the main rule. You must deposit 10% of the smart contract balance to become the leader, and last 1 day as leader. If you send less than 10% your transaction will be rejected.

Disclaimer: The owner of the smart contract or this post is not responsible for any loss in ether. In particular, but not limited to, losses resulting from smart contract bugs or mistakes from the participants.