While not as critical as the other issues, I noticed that the getWhiteListedCollections
function was not optimized for gas efficiency. As the number of collections grew, the gas cost of this function would increase, potentially making it expensive to use.
Description: The function could become increasingly gas-intensive as the number of collections grows, making it prohibitively expensive to execute in some scenarios.
Location:getWhiteListedCollections
function in ethereum
/src
/IStarklane.sol
Issue: The getWhiteListedCollections
function iterates over all collections, which could be gas-inefficient as the number of collections grows. Also, resizing the array in assembly could lead to errors if not carefully handled.
Impact: High gas usage could make the contract prohibitively expensive to use, particularly for large-scale operations.
Tools used: Manual Review.
Recommendations: Optimize the getWhiteListedCollections
function to minimize gas usage, possibly by using more efficient data structures or avoiding unnecessary iterations.
Potential changes: Optimize getWhiteListedCollections
function for gas efficiency.
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.