Omniscia Boson Protocol Audit
ExchangeHandlerFacet Code Style Findings
ExchangeHandlerFacet Code Style Findings
EHF-01C: Multiple Top-Level Type Declarations
Type | Severity | Location |
---|---|---|
Code Style | ![]() | ExchangeHandlerFacet.sol:L14, L20, L29 |
Description:
The ExchangeHandlerFacet
file contains three top-level declarations (Token
, MultiToken
and ExchangeHandlerFacet
).
Example:
contracts/protocol/facets/ExchangeHandlerFacet.sol
14interface Token {15 function balanceOf(address account) external view returns (uint256); //ERC-721 and ERC-2016
17 function ownerOf(uint256 _tokenId) external view returns (address); //ERC-72118}19
20interface MultiToken {21 function balanceOf(address account, uint256 id) external view returns (uint256);22}23
24/**25 * @title ExchangeHandlerFacet26 *27 * @notice Handles exchanges associated with offers within the protocol28 */29contract ExchangeHandlerFacet is IBosonExchangeHandler, BuyerBase, DisputeBase {
Recommendation:
We advise the latter two of the three to be split to their dedicated files to aid in the codebase's maintainability.
Alleviation (44009967e4f68092941d841e9e0f5dd2bb31bf0b):
Both interface
declarations have been omitted from the contract thus optimizing its legibility.