Omniscia Boson Protocol Audit

ExchangeHandlerFacet Code Style Findings

ExchangeHandlerFacet Code Style Findings

EHF-01C: Multiple Top-Level Type Declarations

TypeSeverityLocation
Code StyleExchangeHandlerFacet.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-20
16
17 function ownerOf(uint256 _tokenId) external view returns (address); //ERC-721
18}
19
20interface MultiToken {
21 function balanceOf(address account, uint256 id) external view returns (uint256);
22}
23
24/**
25 * @title ExchangeHandlerFacet
26 *
27 * @notice Handles exchanges associated with offers within the protocol
28 */
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.