Omniscia Kanpeki Finance Audit
ContractAddresses Code Style Findings
ContractAddresses Code Style Findings
CAS-01C: Pre-Calculated Key Lookups
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | ContractAddresses.sol:L27, L32, L37, L42, L47, L52, L57, L62, L67, L72 |
Description:
The linked keccak256
instructions can be stored to constant
variables that are either imported from ContractRegistry
or are declared within the contract itself.
Example:
contracts/ContractAddresses.sol
25function vault () external view override returns (address)26{27 return _REGISTRY.getContract(keccak256("Vault"));28}
Recommendation:
We advise them to be done so to reduce the gas cost of invoking those functions.
Alleviation:
The file is no longer part of the codebase rendering this exhibit irrelevant.