TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: low
Invalid

Mark Immutable and Constant Variables as Private

Summary

In the protocol, several immutable and constant variables are declared without the private visibility specifier. Marking these variables as private can save deployment gas.

Vulnerability Details

Immutable and constant variables declared with default or public visibility result in the compiler generating non-payable getter functions. This increases the deployment gas cost and adds unnecessary entries to the method ID table. By marking these variables as private, the contract can avoid these additional costs while still allowing the values to be read from the verified contract source code.

Impact

By not marking immutable and constant variables as private, the contract incurs higher deployment gas costs. This can be particularly impactful for contracts deployed frequently or on a large scale.

Tools Used

Manual review.

Recommendations

Update the visibility of immutable and constant variables from public to private.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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