20,000 USDC
View results
Submission Details
Severity: low

Calls inside a loop might lead to a denial-of-service attack.

Summary

Vulnerability Details

Calls inside a loop might lead to a denial-of-service attack.

There are 4 instances of this issue:

Exploit scenario

contract CallsInLoop{
address[] destinations;
constructor(address[] newDestinations) public{
destinations = newDestinations;
}
function bad() external{
for (uint i=0; i < destinations.length; i++){
destinations[i].transfer(i);
}
}
}

If one of the destinations has a fallback function that reverts, bad will always revert.

Impact

Tools Used

Recommendations

Favor pull over push strategy for external calls.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.