hats-finance / Inverter-Network-0xe47e52c4fea05e555920f1dcdcc6fb8eca103eeb

Fork of the Inverter Smart Contracts Repository
GNU Lesser General Public License v3.0
0 stars 3 forks source link

Unnecessary imports #23

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

Github username: @erictee2802 Twitter username: 0xEricTee Submission hash (on-chain): 0x6c3654a96efcab552ea0dd736c522dc6b71b5e40e356872ad92c506a78e7cbc7 Severity: low

Description: Description

The following library imports can be removed because they are redundant or not used in the contracts:

Attack Scenario

In InverterBeacon.sol:

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.23;

// Internal Interfaces
import {IInverterBeacon_v1} from "src/proxies/interfaces/IInverterBeacon_v1.sol";

// External Interfaces
import {IBeacon} from "@oz/proxy/beacon/IBeacon.sol";

// External Dependencies
import {Ownable2Step} from "@oz/access/Ownable2Step.sol";
import {ERC165} from "@oz/utils/introspection/ERC165.sol";
import {Ownable} from "@oz/access/Ownable.sol";

/**
 * @title   Inverter Beacon
 *
 * @notice  Manages upgrades and versioning for smart contract implementations, allowing
 *          contract administrators to dynamically change contract logic while maintaining
 *          the state. Supports emergency shutdown mechanisms to halt operations if needed.
 *
 * @dev     Extends {ERC165} for interface detection and implements both {IInverterBeacon_v1} and
 *          {IBeacon}. Uses modifiers to enforce constraints on implementation upgrades. Unique
 *          features include emergency mode control and strict version handling with major
 *          and minor version concepts.
 *
 * @custom:security-contact security@inverter.network
 *                          In case of any concerns or findings, please refer to our Security Policy
 *                          at security.inverter.network or email us directly!
 *
 * @author  Inverter Network
 */
contract InverterBeacon_v1 is IInverterBeacon_v1, ERC165, Ownable2Step {
    //REDACTED

Noticed that Ownable2Step is imported therefore Ownable should be removed.

Attachments

NA

  1. Proof of Concept (PoC) File

Manual analysis

  1. Revised Code File (Optional)

Making the following changes in audit-hats/src/proxies/InverterBeacon_v1.sol:

// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity 0.8.23;

// Internal Interfaces
import {IInverterBeacon_v1} from "src/proxies/interfaces/IInverterBeacon_v1.sol";

// External Interfaces
import {IBeacon} from "@oz/proxy/beacon/IBeacon.sol";

// External Dependencies
import {Ownable2Step} from "@oz/access/Ownable2Step.sol";
import {ERC165} from "@oz/utils/introspection/ERC165.sol";
-- import {Ownable} from "@oz/access/Ownable.sol";

/**
 * @title   Inverter Beacon
 *
 * @notice  Manages upgrades and versioning for smart contract implementations, allowing
 *          contract administrators to dynamically change contract logic while maintaining
 *          the state. Supports emergency shutdown mechanisms to halt operations if needed.
 *
 * @dev     Extends {ERC165} for interface detection and implements both {IInverterBeacon_v1} and
 *          {IBeacon}. Uses modifiers to enforce constraints on implementation upgrades. Unique
 *          features include emergency mode control and strict version handling with major
 *          and minor version concepts.
 *
 * @custom:security-contact security@inverter.network
 *                          In case of any concerns or findings, please refer to our Security Policy
 *                          at security.inverter.network or email us directly!
 *
 * @author  Inverter Network
 */
contract InverterBeacon_v1 is IInverterBeacon_v1, ERC165, Ownable2Step {
    //REDACTED
PlamenTSV commented 5 months ago

Informational, but thanks.

0xmahdirostami commented 5 months ago

thank you @PlamenTSV