How is fullfillRandomWords triggered by the chainlink keeper on our Testnet example? #5566
Unanswered
Ahmedborwin
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@Ahmedborwin This chainlink resource will help you to understand it link |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am wondering how our fullfillRandomWords function is triggered after deploying to sepolia + assign performUpkeep as our target function for our chainlink keeper
With our Hardhat mockOffchain script, we trigger the preformupKeep and then then the fullfillRandomWords.
I think the first part that is confusing me is how an interface works. When I look at the interface contract I only see a few functions one of which is the requestRandomWords and no mention of the fullfillRandomWords function.
However, looking at Sepolia's vrfCoordinatorV2 contract on etherscan i can see the full contract with functions that allow users to requestRandomWords and to fullfillRandomWords.
My questions are (and they might be linked):
How does the logic flow on the vrfCoordinatorV2 contract, so that calling requestRandomWord will ultimately trigger the fullFillRandomWord function on our Raffle contract?
Having defined i_vrfCoordinator = VRFCoordinatorV2Interface(vrfCoordinatorV2);
When we trigger the requestRandomWords on our Raffle contract: i_vrfCoordinator.requestRandomWords() are we directly triggering the requestRandomWords on the vrfCoordinatorV2 sepolia contract?
I apologise if my question is not clear or succinct. Trying to make sense of the unknowns in my own head.
Any help would be much appreciated
Also, if someone can point me toward any material that will help me better understand interfaces, abstract contracts, and how they are used, again I would appreciate this greatly.
Thank you
PS I cannot for the life of me figure out how to get this GitHub post to recognise variable names. If I use the ```Solidity everything after the word interface is purple...
Beta Was this translation helpful? Give feedback.
All reactions