DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Invalid

Arrays

Summary

  1. AN ARRAY’S LENGTH SHOULD BE CACHED TO SAVE GAS IN FOR-LOOPS
    Reading array length at each iteration of the loop takes 6 gas (3 for mload and 3 to place memory_offset) in the stack.
    Caching the array length in the stack saves around 3 gas per iteration.

Impact

More Gas will be used otherwise. for chains like ETH, it can be upto 1$ worth of GAS

Tools Used

Manual Review

Recommendations

  1. Caching the array length in the stack.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Gas

Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

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