Consider using OpenZeppelin's EnumerableAddressSet instead of addres[] to store collections more efficiently
Currently, supported collections, are saved in an address array.
This is especially problematic for _whiteListCollection()
that need to traverse the array in order to avoid adding duplicates entries, as we can see below:
This process, in the worst case scenario, incurs O(N) runtime complexity which consumes lots of gas as N increase since SLOD are expensive operations.
Manual review
Use OpenZeppelin's EnumerableAddressSet
instead of an address array to store collections which allows for inserting operations in 0(1) while checking for duplicates.
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.