HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Unused Event LiquidityAdded in IDIVA.sol

Summary

The LiquidityAdded event is declared in the IDIVA.sol contract but is never used or emitted within the codebase. This creates unnecessary clutter in the contract and increases the risk of confusion during integration or debugging. Such unused elements contribute to technical debt and should be addressed for better maintainability and clarity.

Vulnerability Details

Type: Redundancy and Unused Code

  • Location: IDIVA.sol, Line (exact line depends on your file version):

    @> event LiquidityAdded(
    bytes32 indexed poolId,
    address indexed longRecipient,
    address indexed shortRecipient,
    uint256 collateralAmount
    );
  • Issue:

    • The LiquidityAdded event is defined but not emitted or referenced anywhere in the contract.

    • It appears to be a placeholder or leftover from earlier development iterations but serves no active purpose in the current codebase.

  • Problem:

    • Including unused events adds unnecessary complexity to the contract.

    • Misleads developers, auditors, or integrators into thinking this event has active relevance.

    • May slightly increase the compiled bytecode size, resulting in minor inefficiencies during deployment.

Impact

This issue has a Low severity, as it does not affect the functionality, security, or correctness of the contract. However, it introduces unnecessary complexity and should be resolved to ensure a clean and maintainable codebase.


Tools Used

The following tools were utilized to identify and analyze the issue:

  • Static Code Review: Manual inspection of the code.

  • Solidity Compiler (v0.8.26): Verified the event declaration and potential usage in the bytecode.


Recommendations

  1. Remove the unused LiquidityAdded event:

    // Remove this event declaration from `IDIVA.sol`
    - event LiquidityAdded(
    - bytes32 indexed poolId,
    - address indexed longRecipient,
    - address indexed shortRecipient,
    - uint256 collateralAmount
    - );
  2. Audit Related Contracts: Ensure that other contracts in the system do not rely on this event. If this event was planned for future use, document its purpose clearly to avoid confusion.

  3. Maintain Consistency: If a similar event is defined and used elsewhere, ensure a single, consistent declaration across the codebase.

  4. Document Changes: Record the removal of this event and the reasons behind it in the repository’s change log or documentation.

Updates

Lead Judging Commences

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.