The areListsValid
function is designed to validate two arrays: recipients
and amounts
.
However, the function's implementation includes a nested loop that results in quadratic time complexity 𝑂(n2) . This complexity can make the function susceptible to a Denial of Service (DoS) attack.
The nested loop, which checks for duplicate addresses, leads to a quadratic time complexity of 𝑂(n2). This can exhaust the gas limit, causing the transaction to fail and potentially disrupting the smart contract's functionality.
Resource Exhaustion: The function could consume an excessive amount of gas, leading to out-of-gas exceptions.
Service Disruption: Legitimate users may be unable to interact with the contract if the function call consistently runs out of gas.
Manual review
Use a more efficient method to check for duplicates, such as a mapping. This reduces the time complexity from 𝑂(n2) to 𝑂(n)
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.