0

I'm building a lottery where I need to generate a list of random numbers.

Basically, I have a group of people who will commit to a prize by staking a certain amount of tokens to their commitment - Let's say the higher the stake, the more tickets/probability for the individual to win a share of the prize.

Now, all the tickets associated with the people participating in the lottery, are publicly known in advance, which leads me to my question, how can I safely initialize, compute and store a list of random numbers on-chain?


Let's consider following scenario:
Participants: 3
Lottery Tickets: 30000

Participant A: stake: 10000 tickets: 0-9999
Participant B: stake: 5000 tickets: 10000-14999
Participant C: stake: 15000 tickets: 15000-30000;


Now I wan't to generate let's say a list of 5 random numbers i.e. 123, 1111, 9999, 25252, 30000