20,000 USDC
View results
Submission Details
Severity: gas

## [G-06] Using PRIVATE rather than PUBLIC FOR Constants, Saves Gas

Summary

[G-06] Using PRIVATE rather than PUBLIC FOR Constants, Saves Gas

If needed, the value can be read from the verified contract source code. Savings are due to the compiler not having to create non-payable getter functions for deployment calldata, and not adding another entry to the method ID table

file: /src/Fees.sol
16 ISwapRouter public constant swapRouter =

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Fees.sol#L16

file: /src/Lender.sol
59 uint256 public constant MAX_INTEREST_RATE = 100000;
/// @notice the maximum auction length is 3 days
61 uint256 public constant MAX_AUCTION_LENGTH = 3 days;

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L59-L61

Support

FAQs

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