Get Mystery Box with random crypto!

How the 100 BNB giveaway winners were chosen: 1: The function | Falconx

How the 100 BNB giveaway winners were chosen:

1: The function prepareDraw() is the first function called after the list of participants (and their respective raffle entries) are inputted to the program. The first thing that happens is the program takes a participants wallet address and their raffle entries, and uses this to add their wallet address to the final contestants list - it adds their wallet address x amount of times, where x is their number of raffle entries.


2: Next the list of contestants is randomized 100 times using a simple 50/50 randomization algorithm. This is the same as randomly shuffling a deck 100 times, the result is a reliably randomized order of cards, or in this case user wallets.

3: The winner is then drawn through the use of a random number picker. A random number between 0 and the length of the contestants array is selected and then supplied as an array index, allowing the winner to be chosen (the user at the given array index is the winner). That winner is then presented and removed from the list of contestants. Due to the mechanism in which they're removed, every time a contestant is removed the index of the array that's being checked for the user's wallet address must also be decremented, otherwise it may delete an instance of the users wallet, but in the event their wallet is also the next item in the array, this would mean that it would be skipped (as their wallet that was one ahead will now become one before, which has already been checked, and therefore it would have been skipped from the removal process).