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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: