liquidx-studio.github.io

LiquidXLogo.png


Lucky Draw Process in the Pixelmon Trainer Adventure

Overview

Our Pixelmon trainer adventure allows the holders of our Trainers and Pixelmon tokens to soft stake those tokens and win prizes (sponsor trips, evolution serum, trainer gear, etc.) by participating in weekly lucky draws.

The lucky draw process in the Pixelmon trainer adventure involves generating a collection of tickets and selecting winners based on a pseudo-randomized number generated using a Linear Congruential Generator based on seeds numbers that are randomly generated by Chainlink.

Lucky draw process flow

trainer-adventure-lucky-draw-flowchart.png

1. Ticket generation

Notice that each generated ticket is assigned a monotonically increasing sequence number as the ticket number. Furthermore, each ticket is mapped to the wallet address of its Trainer or Pixelmon.

2. Draw initiation

  1. Every week on Tuesday at 12PM SGT, the lucky draw process is initiated by our backend service.

3. Random number generation using random seeds

Random_number_generation_with_chainlink_seeds

4. Winner selection

Winner_selection

5. Winner selection stored in the smart contract

Once all winners have been chosen for the week, the backend process stores the winning wallet addresses and their respective count of prizes in the Trainer adventure smart contract by calling the updateWeeklyWinners method.

6. Claiming treasure

7. Treasure distribution to the claiming winners

The Smart Contract then finally transfers the treasure from the vault wallet address to the winner wallet address.

Links to deployed smart contracts in the Mainnet

Lucky draw winner verification using ticket list

It is possible to download the tickets distribution for each week’s draw and then run a script to re-create the list of winners for the previous week.

Download verification script and instructions

Data used in the weekly draw process