Immortal Lottery: technical details

Intro

This article describes the general principles of the Immortal Lottery — a decentralized autonomous application designed to work continuously at various blockchains after deployment without any maintenance requirements.

Lottery contracts

The lottery is composed of multiple smart-contracts:
1. Lottery contract — responsible for the logic of playing rounds

Lottery logics

The lottery is held in rounds. Each round must be manually started by a user and the lottery does not automatically start a new round after the previous one has finished.

  • Deposits (a round is running and deposits are allowed, entropy providers can supply entropy hashes to the contract)
  • Reveal (a round is running and entropy providers are revealing their entropy inputs, players are awaiting for this to finish)

Completion of a round

Each round should be completed manually. At this moment the contract is sending the reward to the winner if the round was successful and the round fees are being distributed.

Starting a new round

A round must be started manually by a user. The lottery does not run “empty” rounds.

Staking tokens for rewards

All main lottery contracts send lottery fees to the same reward pool contract. A token holder can stake his IML tokens in the reward pool contract to lock the tokens for a fixed period of time. At the end of the staking round he will be allowed to (1) withdraw reward only or (2) tokens and reward similar to Cold Staking v1 formula.