1
require(address(0) != address)
_mint(address, 1)
emit(address, some_other_info)

If any part fails and transaction fails in general, will the event be emitted?

Can the same event be emitted multiple times? Should I keep track of it? How safe is it? Can hackers imitate events somehow?

good_evening
  • 157
  • 1
  • 10
  • "Can the same event be emitted multiple times? Should I keep track of it? How safe is it? Can hackers imitate events somehow?" - please move all of that to separate questions. – goodvibration Nov 26 '20 at 19:29

1 Answers1

4

Events are written into the blockchain along with any other piece of data (state variables, ether balances, etc) modified during the transaction.

When the transaction reverts, all data modifications are reverted along with any event which was emitted during the transaction.

goodvibration
  • 26,003
  • 5
  • 46
  • 86