Omniscia Boson Protocol Audit
DiamondLib Code Style Findings
DiamondLib Code Style Findings
DLB-01C: Redundant Conditional Return Statement
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | DiamondLib.sol:L81 |
Description:
The || false
conditional included in the return
statement of supportsInterface
is redundant as the ds.supportedInterfaces[_interfaceId]
value can only be either true
when explicitly set or false
when explicitly set or unset.
Example:
contracts/diamond/DiamondLib.sol
81return ds.supportedInterfaces[_interfaceId] || false;
Recommendation:
We advise the latter of the conditional to be omitted optimizing the gas cost of the function in all false
cases.
Alleviation (44009967e4f68092941d841e9e0f5dd2bb31bf0b):
The redundant conditional evaluation has been safely omitted from the codebase.