7

Good day.

I'm trying to grasp the concept of events in the EVM and I just can't understand what is the incentive of using events. Why not just use a dedicated public index that will hold information? Isn't the event data just stored on the block chain like a regular variable?

As always, your help is appreciated.

1 Answer 1

5
  1. Events are the built-in way for something external, such as a user interface, to be notified of something from the blockchain. When an event is emitted, the watchers of that event are notified. No notifications happen when a contract variable is updated.

  2. Events are stored differently and are much cheaper than using contract storage. Contracts cannot access logs directly.

Events are not in the EVM (you won't find them in the Yellow Paper); events in Solidity and Serpent are wrappers around the LOG opcode in the EVM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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