You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linked constant declarations are meant to be assigned to the result of a keccak256 instruction. Contrary to the expected, constant variables are evaluated as expressions and as such the gas optimization of caching the result of the keccak256 instruction is actually not achieved here.
We advise the immutable keyword to be utilized instead to actually take advantage of the gas benefit of pre-calculating the keccak256 hash. For more information, consult this issue in the Solidity compiler.
The text was updated successfully, but these errors were encountered:
SCS-01C: Inefficient Hash Constants
Description:
The linked
constant
declarations are meant to be assigned to the result of akeccak256
instruction. Contrary to the expected,constant
variables are evaluated as expressions and as such the gas optimization of caching the result of thekeccak256
instruction is actually not achieved here.Example:
Recommendation:
We advise the
immutable
keyword to be utilized instead to actually take advantage of the gas benefit of pre-calculating thekeccak256
hash. For more information, consult this issue in the Solidity compiler.The text was updated successfully, but these errors were encountered: