Omniscia Moby Audit
ContextUpgradeable Code Style Findings
ContextUpgradeable Code Style Findings
CUE-01C: Potentially Redundant Contract Implementation
Type | Severity | Location |
---|---|---|
Gas Optimization | ContextUpgradeable.sol:L16-L32 |
Description:
The ContextUpgradeable
implementation is meant to be utilized if the system is expected to comply with EIP-2771 and should be avoided otherwise as it incurs extraneous gas.
Example:
contracts/proxy/ContextUpgradeable.sol
16abstract contract ContextUpgradeable is Initializable {17 function __Context_init() internal initializer {18 __Context_init_unchained();19 }20
21 function __Context_init_unchained() internal initializer {22 }23 function _msgSender() internal view virtual returns (address) {24 return msg.sender;25 }26
27 function _msgData() internal view virtual returns (bytes calldata) {28 this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/269129 return msg.data;30 }31 uint256[50] private __gap;32}
Recommendation:
We advise the Moby team to evaluate whether they wish to integrate EIP-2771, and omit the ContextUpgradeable
implementation if they do not wish so.
Alleviation (b02fae335f62cc1f5f4236fb4d982ad16a32bd26):
The Moby team evaluated this exhibit but opted to acknowledge it in the current iteration of the codebase