Skip to content

How does this line "VRFCoordinatorV2Interface(vrfCoordinator)" work? #466

Answered by PatrickAlphaC
cipher222 asked this question in Q&A
Discussion options

You must be logged in to vote

I love the annotations :)

So, you can call functions on a contract when you have two things:

  1. The address
  2. The ABI

That line basically "wraps" that address in the ABI, allowing us to call any function in the contract at that address. So we are saying:

At address vrfCoordinatorV2, we assume it has functions from the ABI VRFCoordinatorV2Interface.

Does that make sense?

Replies: 1 comment 1 reply

Comment options

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

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