You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### What
The contractevent attribute macro now accepts fieldless unit structs
such as `pub struct MyEvent;`, treating them as events that carry no
topic or data fields and emit only the default prefix topic derived from
the struct name.
### Why
Issue #1571 reports that the macro only worked on structs with named
fields and rejected unit structs with a hard compile error, which
prevented defining simple event markers that carry no additional data.
Empty braced structs (`pub struct MyEvent {}`) already worked, so the
gap was specifically the unit-struct form.
### Known limitations
When a contract's spec is regenerated via contractimport!, a fieldless
event is rendered as an empty braced struct (`pub struct MyEvent {}`)
rather than a unit struct, because the on-wasm spec records only that
the event has no parameters and does not preserve the unit-versus-braced
distinction. The generated type produces an identical on-chain event so
that difference is of little consequence.
Close#1571
---
_Generated by [Claude
Code](https://claude.ai/code/session_011mKQ41rU7Ze9hxQAUEdfmk)_
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
0 commit comments