Why `event::emit` take owned object?

owned object seems too strict, ideally it should just take a immutable ref. emit just serialize an object.

1 Like

In typical use, a programmer builds up a specialized event struct (e.g., PaymentEvent), pipes it into event::emit, and then moves on. Asking for ownership of the event struct encourages this flow, whereas asking for a reference would suggest that the event struct might be used afterward (which is not typical/recommended).

However, you are right that in theory Sui Move could provide a variant event::emit that accepts a reference, and I suspect folks would be open to this if there is a compelling use-case.