Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Invalid

Constant variables should be marked as private

Summary

Setting constants to private will save deployment gas. This is because the compiler won't have to create non-payable getter functions for deployment calldata, won't need to store the bytes of the values outside of where it's used, and won't add another entry to the method ID table. The values can still be read from the verified contract source code if necessary.

Vulnerability Details

In the mentioned links there are constant variables, that are public.

Impact

Deployment gas waste.

Tools Used

Manual review.

Recommendations

Change constants from public to private:

e.g:

-- uint256 public constant SAFE_MULTIPLIER = 1e18;
++ uint256 private constant SAFE_MULTIPLIER = 1e18;
Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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