Skip to content

How to find out random winner? #4912

Answered by pacelliv
deepak2301 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @deepak2301, the truth is that there's no real randomness when we work in our local blockchain, the VRFCoordinatorV2Mock uses a hash function to create a pseudo-random number and this number will always be the same because the function always receives the same inputs. So when the number is sent to raffle and the modulo operator is apply to the array of players it always return the same winner.

The objective of the VRFCoordinatorV2Mock is to only mimick the behavior of the real VRFCoordinatorV2.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@umairahmed88
Comment options

Answer selected by alymurtazamemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants