A guide to events and logs in Ethereum Smart Contracts
Events and logs in Ethereum play a vital role since they are responsible for communication between the user interface and smart contracts. Similar to callback response in traditional web development, Ethereum uses smart contracts for the emission of events and writes logs to address the same. Events and logs used in Ethereum has three main use cases, Smart contract return values for the front end Asynchronous triggers with data A cheaper form of storage Let us get to know about each of them in detail. Events and Logs in Ethereum - Use Cases #1 Smart contract return values for the front end The first use case is sending return values from the contracts to the user interface(front-end). The contract execution is simulated so that the return value can be obtained. This whole concept arose since transactions cannot return a value. This issue was taken care of with the advent of events. #2 Asynchronous triggers with data Asynchronous triggers with data are nothing but events. When th...