15,000 USDC
View results
Submission Details
Severity: gas

[GAS-2] Use calldata instead of memory for function arguments that do not get mutated

Summary

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.

Vulnerability Details

Instances (1):

File: src/DSCEngine.sol
112: constructor(address[] memory tokenAddresses, address[] memory priceFeedAddresses, address dscAddress) {

Impact

Tools Used

Recommendations

Support

FAQs

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