Skip to content

Lesson 9: Events and arguments #1947

Answered by othaime-en
doz-8108 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @doz-8108 your assessment is partly true. Yes there are two events being emitted, but not in the order you put them. If you look at the code, we call the function i_vrfCoordinatorV2.requestRandomWords(...) first then we emit RequestRaffleWinner(requestId) So technically, the event at index 0 is the one emitted by i_vrfCoordinatorV2.requestRandomWords(...) then the event at index 1 is the one emitted by RequestRaffleWinner(requestId) That's why the first event (event at index 0) doesn't have args while the second has one arg (requestId) the one we put in the event declaration of RequestRaffleWinner

Concerning the absence of args in the first event being emmitted, as @krakxn has explain…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@othaime-en
Comment options

@krakxn
Comment options

@othaime-en
Comment options

@doz-8108
Comment options

Answer selected by doz-8108
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