Additional Solidity Concepts - Discussion

Do I understand correctly that all emitted events are logged to the blockchain? If so, is that a relatively expensive operation?

1 Like

Hi @letscrypto,

The emitted events are logged in the transaction data. You can see the log created in the transaction detail, by clicking on the arrow next to the transaction confirmation in the panel below the code editor in Remix. My understanding is that all of this transaction data (including the event logs) are hashed and then included in one of the mined blocks. However, event data is not stored in smart contract state variables and so this reduces their cost in terms of gas. As well as being part of the transaction hash, which becomes an immutable part of the Ethereum blockchain, the actual raw (unhashed) event log data is also stored in the nodes as part of the transaction receipt. This is the event log data which can then be accessed by the dapp for end-user display, data analytics, and data management purposes.

Again, Iā€™m tagging @gabba so that he can add any further clarification, or correct any inaccuracies in my explanation.

2 Likes