15,000 USDC
View results
Submission Details
Severity: gas

State varaibles only set in the Constructor should be declared Immutable

Summary

[G-13] State varaibles only set in the Constructor should be declared Immutable

Avoids a Gsset (20000 gas) in the constructor, and replaces the first access in each transaction (Gcoldsload - 2100 gas) and each access thereafter (Gwarmacces - 100 gas) with a PUSH32 (3 gas).

file: /script/HelperConfig.s.sol
27 activeNetworkConfig = getSepoliaEthConfig();

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/script/HelperConfig.s.sol#L27

Support

FAQs

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