The following library imports can be removed because they are redundant
or not used in the contracts:
Ownable.sol in audit-hats/src/proxies/InverterBeacon_v1.sol.
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
Proof of Concept (PoC) File
Manual analysis
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
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:
Ownable.sol
inaudit-hats/src/proxies/InverterBeacon_v1.sol
.Attack Scenario
In
InverterBeacon.sol
:Noticed that
Ownable2Step
is imported thereforeOwnable
should be removed.Attachments
NA
Manual analysis
Making the following changes in
audit-hats/src/proxies/InverterBeacon_v1.sol
: