Skip to content

#[aztec(event)] macro #2323

@benesjan

Description

@benesjan

It makes sense to use structs to define events in Noir. The only difference between arbitrary structs and event structs would be that the event structs should have a selector as the first field in the struct. Noir would then correctly serialize this selector as the first field when we dump this struct into the event oracle. The selector would be the same thing as event selector in Ethereum -> we would include the struct info in ABI -> based on this struct info we would then be able to compute the selector and later on match the raw logs with the event in the ABI using this selector.

Since we don't want to force users to declare and compute this selector manually I would create an #[aztec(event)] macro which would compute the selector and place it on the first position.

I don't know enough about macros in Noir to be able to asses how achievable this is so it would be nice to get a feedback from @kevaundray, @Maddiaa0, @sirasistant and anyone else who feels like chiming in.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions