0

Should I emit Transfer event, when zero amount of Ether or of a token is transferred?

Variants of the answer:

  • yes
  • no
  • both are OK

1 Answer 1

1

There's no harm in emitting the event for both.

Events are more about letting an external entity that something (ex. a function call) happened with certain parameters. If there are zero cases, let the external entity handle that scenario instead of choosing for them.

1
  • 1
    From the EIP-20 standard Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.
    – Ismael
    Commented Mar 27, 2018 at 14:29

Your Answer

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

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