How To: Verify the Random Numbers Used for the Competitions!

Winlambo
3 min readMay 27, 2021

The most pressing question is always, how can I verify that the winner of your competitions won fair and square?

The answer is, it’s on-chain! And on top of that, the random winning number comes from a trusted, independent, third party named Chainlink!

Chainlink has a set of smart contracts they offer called Chainlink VRF.
These contracts allow us to request a number from them that is guaranteed to be random, trusted, and tamper-proof!

So how do you use Chainlink VRF?

We use Chainlink’s VRF contracts every day for our daily competitions! And we also use it for our big Lambo events!

The number that is returned from Chainlink’s smart contracts is used to determine the winning tickets for our Jackpots. You can see how the winning tickets are derived from the random number here.

For this article, we want to show you specifically how we request the random number, and how the random number is returned to us on-chain for everyone to see!

How do you request the random number?

To request the random number, we go to our random number generator, and we call the getRandomNumber function from our deployer. Only our deployer is able to call that function. Nobody else. And you can verify it in the code.

Here’s a sample screenshot for one of our previous dailies.

Screenshot of request for random number.
Requesting a random number for the Daily Jackpot

The transaction associated with this request can be seen at https://medium.com/r/?url=https%3A%2F%2Fbscscan.com%2Ftx%2F0xa400e669636203892aa48fe6b48787d664d8e9dfc12394603da2bca94655437d%23eventlog.
Scrolling down to the last log on that transaction, we can see a requestID.
This requestID can be used anytime in the future to retrieve the random number that is associated with this request!

How do you view the random number?

The request ID for the example above is BCFD18AE207E95D5A682336425D13E2179AF563B79B3F23C4DB90B913537DB33

If you take that request ID and enter it, prefixed with a 0x, in the potResultHistory field of our random number generator, you can see the random number that is associated with that request.
In this case, the random number is 32348944249030050051462067070971608188121853605915475450281631041640789425975

Here’s a screenshot demonstrating it.

The random number associated with a request ID.
Viewing the random number associated with a request ID

There you can see all that you need to verify the random number that is returned from Chainlink, and used for our Jackpots!

That, combined with the explanation of how we use that random number to determine the winner, gives you the full picture of how our Daily and Lambo Jackpots work!

Thank you for reading!

Disclaimer

WINLAMBO is beta software. Use at your own risk.

WINLAMBO is not available to players in the United States.

WINLAMBO is a Defi experiment. The WINLAMBO token carries no intrinsic financial value and does not pretend otherwise.

WINLAMBO contracts have not been audited yet, however our team contributors and developers have made reasonable efforts to ensure the protocols integrity through rigorous testing and collaboration, as well as, by developing WINLAMBO using battle-tested code.

Any person or entity who chooses to engage with the WINLAMBO and associated contracts are doing so completely at their own risk.

The WINLAMBO developmental roadmap aspirational and delivery (or non-delivery) of these objectives is entirely at the teams sole discretion.

To facilitate faster development and improvements, the WINLAMBO team will remain anonymous in line with Defi industry practice.

The WINLAMBO team and community will not be liable in any way for financial losses incurred due to your use of WINLAMBO platform or WINLAMBO token.

Please perform your own due diligence and thorough research on WINLAMBO and the other protocols before taking any action.

--

--