40,000 USDC
View results
Submission Details
Severity: gas

Use calldata instead of memory for function arguments that do not get mutated

Summary

Use calldata instead of memory for function arguments that do not get mutated

Vulnerability Details

Mark data types as calldata instead of memory where possible. This makes it so that the data is not automatically loaded into memory. If the data passed into the function does not need to be changed (like updating values in an array), it can be passed in as calldata. The one exception to this is if the argument must later be passed into another function that takes an argument that specifies memory storage.

Impact

COST MORE GAS

Tools Used

manually

Recommendations

Consider using calldata instead of memory.

Support

FAQs

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