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.
Trainer(s) are soft-staked by their holders with or without the Pixelmon token.
During the week of the draw, a scheduler process identifies Trainers and Pixelmons that were soft-staked for a minimum of 7
days and assigns 1
ticket for the Trainer and 1
ticket for Pixelmon token.
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.
12PM SGT
, the lucky draw process is initiated by our backend service.In the lucky draw, the backend process considers tickets that are distributed before 8:30 AM SGT
. Furthermore, if a Trainer or a Pixelmon gets unstaked, transferred, or sold by the user before 9:00AM SGT + draw initialization time(5-15 mins)
, the associated tickets with those unstaked tokens are not considered for the draw.
No wallet address can win more than two rewards in a single week.
A wallet address can win at most 1
sponsor trip.
Each week, the winning tickets are chosen from a pool of eligible tickets available for that particular week’s draw.
The wallet addresses associated with that tickets become the winner of the rewards.
Every Tuesday between 9am-12pm SGT
, our backend service calls our smart contract’s generateChainLinkRandomNumbers
method
Our smart contract receives 3
randomly generated seed numbers from Chainlink.
Based on those 3
randomly generated seed numbers (uint256
), the backend generates 163
pseudo-randomized numbers using the Linear congruential generator, * more ref
The backend process then sorts all tickets based on the ticket number
and creates an array of tickets that are used for selecting winners for that week.
For each round of winner selection:
3
random seeds in the Linear congruential generator formula, the backend process chooses the winning index within the array of tickets.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.
According to the claiming start and end timestamps, the winner of a week’s draw calls the claimTreasure
method in our Trainer adventure smart contract using our Pixelmon staking site to claim their treasure.
getRandomNumber
method in the smart contract) provided that there are other types of rewards available in its vault.The Smart Contract then finally transfers the treasure from the vault wallet address to the winner wallet address.
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.
2
and file name format is tickets-week-{Week Number}.csv