A very simple yet fun and incentivized lottery game on ICON blockchain network.
Unlike other gamble or lottery Dapps, this game utilizes and features
-
Very simple rule, no multiple rounds running simultaneously, only one
-
Subsidy funded by ICONVIET in launch phase, which is very attractive and incentivizing early participants
-
Probabilistic pseudorandom selection algorithm in smart contract environment, which allows players taking greater risk with big bets, and rewards them accordingly as well.
Given such simplicity, this game just needs a very simple UI to display a few neccessary information about on-going lottery round.
In order to play this game, you only need to know and do one thing : send ICX, the chance of winning is proportional to the size of ICX deposit.
If you are interested in contract API, see here
PLAYERS
: a record of players ( mapping between ICX addresses and deposit size )
JACKPOT
: accumulated amount of ICX deposited to this lottery contract in one single round
LAST_SETTLEMENT_BH
: the height of block in which previous winner selection procedure was executed
LAST_WINNER
: address of the winner in previous round
TOP_DEPOSIT
: highest recorded ICX amount transferred by a single player in current round
DEPOSIT_BH
: the height of block which contains the transaction of ICX deposit to this lottery contract by a certain player
TX_HASH
: the hash of winner selection transaction
MAX_SUBSIDY
: determine the maximum amount of ICX held in the contract for subsidizing the final prize to reach POT_LIMIT
for each round. Must not be greater than POT_LIMIT
POT_LIMIT
: the limit of JACKPOT
, it helps to prevent huge loss in case of contract bug and hack
COMMISSION
: ICX amount in JACKPOT
to be tranferred to PROFIT_HOLDER
after each round, in form of percentage, e.g. 5%
PROFIT_HOLDER
: address that hold profit from commission
-
Players can send their ICX to the contract whenever they want, sender’s addresses are included in
PLAYERS
list of the contract. Here we haveNEW_DEPOSIT
as tranferred ICX amount-
If
JACKPOT
+
NEW_DEPOSIT
exceedsPOT_LIMIT
, transaction will fail
-
-
When
draw_winner
function of the contract is called by someexternal_agent
( contract cannot trigger itself )-
There must be at least 2 players in current round
-
The settlement procedure is executed
-
The winner is chosen
-
PLAYERS
record and other relevant variables are also reset -
COMMISSION
percentage ofJACKPOT
is transferred toPROFIT_HOLDER
, and the rest to the winner.
For instance, assumeCOMMISSION
is 5%, we have-
5% of
JACKPOT
is transferred toPROFIT_HOLDER
-
95% to the prize
-
-
If
MAX_SUBSIDY
is greater than zero andJACKPOT
still less thanPOT_LIMIT
, then-
FINAL_PRIZE = JACKPOT + MAX_SUBSIDY
-
If
FINAL_PRIZE
is greater thanPOT_LIMIT
, it will be cut down toPOT_LIMIT
-
-
-
If
LAST_SETTLEMENT_BH
andDEPOSIT_BH
is the same, and if ICX deposit transaction is executed after the winner drawing transaction, that sender will be inPLAYERS
list of the next round. -
For each player, the probability of being chosen as winner is proportional to the size of ICX deposit.
-
Winner is chosen by a pseudo-random function with random seed composed of
TX_HASH
` `number of PLAYERS` `
JACKPOT
( string concatenation )
The winner selection procedure is
-
Based on pseudo-random function, hence no one is able to manipulate and game the system ( assume there is no bug )
-
Contract code is public and can be audited by anyone
-
All governance parameters are set by ICONVIET, including
-
MAX_SUBSIDY
is 400 ICX, funded by ICONVIET -
POT_LIMIT
is 1000 ICX per day -
COMMISSION
is 0%
-
-
Winner selection is triggered by ICONVIET for approximately each 43200 blocks period ( daily )
This phase will last for at least one month, to keep bugs under control ( if any ), as well as gathering insights for further development.