The Graph.
Log in

Will Contract Function Update Variable Value?

Discussion
  • INDEXERS

If a contract function emits an Event A, updates a variable, and then emits Event B, will the variable value be updated in Event A handler or Event B handler?

Add comment

Answers1

event A's handler will fetch the previous state of the variable because it is executed before the variable is updated within the transaction, event B's handler will fetch the updated state of the variable because it is executed after the update occurs within the transaction.

Add comment

Do you know the answer?

Please log in and share it.

Log in