Cant seem to figure this one out maybe someone can give me some tips..
I have contract 1 calling contract 2 which is chanlinks VRF, however the random number takes a while to get and it gets stored inside a variable which then you need to call the getter function to know what it is.
question is how can I have contract 1 wait for the number to generate(sometimes takes up to 1min) before being able to use that number inside contract1?
something that would perform the same as "await tx.wait()"
Sep 3, 2022, 12:17 AM
I didn't understand. Did you setup the callback function?
Sep 3, 2022, 8:02 AM
man this took me a while to figure out but apparently you can map the request id to user and when chainlink fufills the random number it calls fufillRandomWords, its inside that function where you can place your logic
Sep 3, 2022, 1:09 PM
of course
how can you retrieve it otherwise?
Sep 3, 2022, 1:11 PM
well didnt know..
Sep 3, 2022, 1:15 PM
did you read this https://docs.chain.link/docs/vrf/v2/introduction/
?
Sep 3, 2022, 1:16 PM
thanks for the reply freez
Sep 3, 2022, 1:21 PM
np
Sep 3, 2022, 1:24 PM