Description:
The batch
function in the contract allows users to execute multiple function calls in one transaction. However it lacks a check for empty arrays, which can lead to unintended behaviour. If an empty array is passed as an argument, the function will attempt to iterate over it, resulting in no operations being performed and potential confusion for users.
Impact:
While passing an empty array does not directly risk funds, it can disrupt the intended functionality of the batching
mechanism. This may lead to user frustration
, wasted gas fees
, and decreased trust
in the contract’s reliability, especially in scenarios where automated processes depend on this function.
Proof of Concept:
Place this test in the batch.t.sol
file.
The function passes unexpectedly as seen below:
Recommended Mitigation:
Would recommend to add a empty arrays check as seen below:
When the same function is tested after the implemented fix this what outputs in the logs:
Meaning that the fix is effective.
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.