Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low
Valid

Gas Limit for Loops

Description:

In the constructor of the ProxyFactory contract, if _whitelistedTokens is extensive, the loop processing it could consume excessive gas, potentially exceeding the block's gas limit.

Impact:

If the gas limit is surpassed, the constructor will fail to execute, impeding the deployment of the contract.

Proof of Concept:

  • Deploy the ProxyFactory contract.

  • Use an extremely large _whitelistedTokens array as input to the constructor.

  • Attempt to deploy the contract, and the deployment fail due to surpassing the gas limit.

Recommendation:

For scenarios where _whitelistedTokens could be large, consider breaking down the array processing into smaller chunks or optimize the code to mitigate gas consumption and prevent exceeding the gas limit.

Support

FAQs

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