Verify
Don't Trust Verify
Last updated
Don't Trust Verify
Last updated
All results can be verified by anyone on smart contract on polygonscan.
Each requests to Chainlink has a requestId and a Random Number seed , that it can be seen on each request on logs tab.
To get requestId from Chainlink use read function requestNumberIndexToRequestId with the request counter id, (request counter id is a infinite number that increments on each draw starting from 0), to check if requestId matches the request counter id run the read function requestIdToRequestNumberIndex.
You can get the random number info on read function requestNumberIndexToRandomNumber.
This is the number which we use to generate the results using modulo math, to check the result you need to check number of players at that draw ID running read function numberOfPlayers function with draw ID.
If for example it had 31 players and randomWords as 32123300067369566142430597366058144063309315440346383261562471505552091797105we will use modulo function to get array position like that:
result = 32123300067369566142430597366058144063309315440346383261562471505552091797105% 31
example on how its done inside the contract:
Get ticket ID position on raffle array >
Inside contract we get the modulo result to find the winner ticket:
We then get the owner of that ticket by checking TicketsHistory storage :
You can also check previous jackpot winners with read functions getJackpotWinnerByLotteryId or JackpotWinHistory
Last winner address with read function OurLastWinner
All the code logic can be seen on smart contracts source code which is well commented, like the buy function in BuyTicket(), and result getter function on fulfillRandomWords() and more.