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

[N-1] Event is missing indexed fields #1

Open
juniormp opened this issue Apr 10, 2023 · 0 comments
Open

[N-1] Event is missing indexed fields #1

juniormp opened this issue Apr 10, 2023 · 0 comments

Comments

@juniormp
Copy link
Owner

juniormp commented Apr 10, 2023

Comments

If you're creating an event function with more than two parameters, it's a good idea to index the ones that you'll be searching for later. This will help you filter through the logs and find the data you need more easily. Just remember that indexing too many fields can increase the gas cost, so be mindful of that as well.

Instances

event BathTokenCreated(address bathToken, address underlying);
event BuddySpawned(address bathToken, address bathBuddy);
https://github.com/juniormp/audit-2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/BathHouseV2.sol#L23
https://github.com/juniormp/audit-2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/BathHouseV2.sol#L24

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

No branches or pull requests

1 participant