2

Why would I need to use events when I can access a contract's variables through the automatic accessor functions?

Please explain the use of and/or need for events.

2

No, not exclusively for real-time updates.

Events are inexpensive, well-organized storage, so there are many possible uses.

Have a look here, for example. How can we retrieve the evolution of the state of an smart contract variable?

In my opinion it's a good habit to emit events that describe all state changes in the contract.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.