Will Contract Function Update Variable Value?
- 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?
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.