The batchApproveCollateralTokenForAave on line https://github.com/Cyfrin/2025-01-diva/blob/1b6543768c341c2334cdff87b6dd627ee2f62c89/contracts/src/AaveDIVAWrapper.sol#L202 function lacks proper validation of input parameters. If an empty or invalid array is passed, the function processes without effect or fails unexpectedly.
The function processes user-supplied arrays without checking if the array is empty or contains invalid collateral token addresses. This could lead to wasted gas fees or failure in specific edge cases.
For example:
If _collateralTokens is an empty array, the loop won’t execute, wasting user gas fees unnecessarily.
While the impact is minimal, the lack of validation can inconvenience users and result in inefficient function execution.
Users waste gas fees on empty or invalid transactions.
Manual code review
Add input validation to check for empty arrays:
2 Address Validation:
Ensure each token address is valid (e.g., not address(0)):
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.