In JavaScript, one can use Math.random() to generate a “random” number. We put this in quotes because the number generated isn’t truly random. Thus, it cannot be used by UpsideFinance to select a random winner for the lossless lotteries. The function mentioned earlier generates a pseudo-random number, which will eventually…