Omniscia Beanstalk Audit
LibDiamond Code Style Findings
LibDiamond Code Style Findings
LDD-01C: Gas Optimization Deviation
Type | Severity | Location |
---|---|---|
Gas Optimization | LibDiamond.sol:L18 |
Description:
The linked LibDiamond
implementation is meant to represent the version 3 implementation of the standard by the EIP-2535 author, however, it does not apply the latest gas optimizations.
Example:
protocol/contracts/libraries/LibDiamond.sol
7/******************************************************************************\8* Author: Nick Mudge <nick@perfectabstractions.com> (https://twitter.com/mudgen)9* EIP-2535 Diamond Standard: https://eips.ethereum.org/EIPS/eip-253510/******************************************************************************/11
12import {IDiamondCut} from "../interfaces/IDiamondCut.sol";13import {IDiamondLoupe} from "../interfaces/IDiamondLoupe.sol";14import {IERC165} from "../interfaces/IERC165.sol";15import {IERC173} from "../interfaces/IERC173.sol";16import {LibMeta} from "./LibMeta.sol";17
18library LibDiamond {
Recommendation:
We advise the delta to be resolved with the original implementation located under the author's GitHub account to optimize the codebase.
Alleviation:
The LibDiamond
contract code was properly updated according to the latest iteration of it by its author optimizing the codebase.