15,000 USDC
View results
Submission Details
Severity: low

Array does not have a pop function

Summary

Arrays without the pop operation increase the likelihood of out-of-gas errors.

Vulnerability Details

Arrays without the pop operation increase the likelihood of out-of-gas errors.

120 s_collateralTokens.push(tokenAddresses[i]);

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L120

Impact

It could happen that array grows large enough to trigger out of gas errors while dealing with it

Tools Used

Manual review

Recommendations

Add functionality that could remove items from the array

Support

FAQs

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