20,000 USDC
View results
Submission Details
Severity: gas

## [G-10] Expressions for constant values such as a call to keccak256(), should use immutable rather than constant

Summary

[G-10] Expressions for constant values such as a call to keccak256(), should use immutable rather than constant

While it doesn't save any gas because the compiler knows that developers often make this mistake, it's still best to use theright tool for the task at hand. There is a difference between constant variables and immutable variables, and they shouldeach be used in their appropriate contexts. constants should be used for literal values written into the code, and immutablevariables should be used for expressions, or values calculated in, or passed into the constructor.

file: /src/Lender.sol
///@audit ' poolId ' on line number 15
113 poolId = keccak256(abi.encode(lender, loanToken, collateralToken));

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

Support

FAQs

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