Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[aztec(event)] macro #2323

Closed
benesjan opened this issue Sep 15, 2023 · 1 comment
Closed

#[aztec(event)] macro #2323

benesjan opened this issue Sep 15, 2023 · 1 comment
Assignees

Comments

@benesjan
Copy link
Contributor

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.

@benesjan
Copy link
Contributor Author

Finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants