Q1 2025 Web3 Security ReportAccess control failures led to $1.63 billion in losses
Discover report insights
  • Hacken
  • Audits
  • neptune-mutual
  • [SCA] Neptune Mutual / Liquidity Pool / Sep2023
Neptune Mutual logo

Neptune Mutual

Audit name:

[SCA] Neptune Mutual / Liquidity Pool / Sep2023

Date:

Oct 21, 2023

Table of Content

Introduction
Audit Summary
Document Information
System Overview
Executive Summary
Risks
Findings
Appendix 1. Severity Definitions
Appendix 2. Scope
Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Neptune Mutual team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

Neptune is a marketplace for parametric cover to protect users’ digital assets from security and custody risks.

titlecontent
PlatformEVM
LanguageSolidity
TagsLiquidity Pool
Timeline01/09/2023 - 23/10/2023
Methodologyhttps://hackenio.cc/sc_methodology

    Review Scope

    Repositoryhttps://github.com/neptune-mutual-blue/periphery/
    Commite90464d07b425f5f1a85959e1c196a0a8ae43282

    Audit Summary

    Total9.7/10
    Security Score

    10/10

    Test Coverage

    100%

    Code Quality Score

    9/10

    Documentation Quality Score

    9/10

    18Total Findings
    10Resolved
    1Accepted
    4Mitigated

    The system users should acknowledge all the risks summed up in the risks section of the report

    Document Information

    This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.

    The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.

    Document

    NameSmart Contract Code Review and Security Analysis Report for Neptune Mutual
    Audited ByHacken
    Websitehttps://neptunemutual.com/
    Changelog08/09/2023 - Initial Review
    09/10/2023 - Second Review
    23/10/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Neptune Mutual
      Audited By
      Hacken
      Changelog
      08/09/2023 - Initial Review
      09/10/2023 - Second Review
      23/10/2023 - Third Review

    System Overview

    Neptune Mutual is a liquidity pool protocol with the following contracts:

    • LiquidityGaugePool — a protocol that manages deposits to the liquidity pool and distribution of NPM token rewards to users who contribute liquidity to the protocol and engage in staking.

    • LiquidityGaugePoolController — an abstract contract that is inherited by LiquidityGaugePool to manage pool info registries.

    • LiquidityGaugePoolReward — an abstract contract that is used by LiquidityGaugePool to calculate rewards and update voting powers.

    • LiquidityGaugePoolState — an abstract contract to be used as storage of variables.

    Privileged roles

    • The admin of the LiquidityGaugePool can:

      • pause/unpause the contract

      • set all the pool info

    • The NSROLESPAUSER role of LiquidityGaugePool_ contract can:

      • pause the contract

    • The NSROLESRECOVERYAGENT role of the LiquidityGaugePool contract can:

      • recover/withdraw assets (except staking and reward tokens) from the contract

    Executive Summary

    Documentation quality

    The total Documentation quality score is 9 out of 10.

    • Functional requirements are provided.

    • Technical description is provided.

    • NatSpec format was missing.

    Code quality

    The total Code quality score is 9 out of 10.

    • Style guide is violated.

    • The development environment is configured.

    Test coverage

    Code coverage of the project is 100% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • Although the coverage tool result is sufficient, interactions by several users are not tested thoroughly. For instance, withdrawing rewards from different users and comparing the results is missing.

    Security score

    Upon auditing, the code was found to contain 0 critical, 9 high, 3 medium, and 2 low severity issues. Out of these, 9 issues have been addressed and resolved, leading to a Security score of 10 out of 10.

    All identified issues are detailed in the “Findings” section of this report.

    Summary

    The comprehensive audit of the customer's smart contract yields an overall score of 9.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    The LiquidityGaugePool relies on external contracts for reward calculation, which were not part of this audit. Any vulnerabilities, changes, or unexpected behaviors in these external contracts can directly impact the reward distribution in the LiquidityGaugePool. Users and the platform might face inaccurate or unintended reward distributions due to external dependencies.

    Every user has to wait at least a minimum 100-block waiting period after each deposit before they can withdraw funds. Even if users have previously deposited assets, the waiting period is calculated based on the most recent deposit for all.

    Findings

    Code
    Title
    Status
    Severity
    F-2023-0711Unrestricted Token Recovery
    fixed

    High
    F-2023-0710Highly Permissive Owner Access
    fixed

    High
    F-2023-0709Mishandled Edge Case
    mitigated

    High
    F-2023-0708Highly Permissive Owner Access
    fixed

    High
    F-2023-0707Missing Storage Gaps
    fixed

    High
    F-2023-0706Undocumented Functionality
    mitigated

    High
    F-2023-0705Denial Of Service; Highly Permissive Owner Access
    fixed

    High
    F-2023-0704Unverifiable Logic
    accepted

    High
    F-2023-0703Coarse-grained Access Control; Data Inconsistency
    fixed

    High
    F-2023-0714Lack of Emergency Withdrawal Mechanism
    fixed

    Medium
    1-10 of 18 findings

    Identify vulnerabilities in your smart contracts.

    Appendix 1. Severity Definitions

    When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.

    Reference on how risk scoring is done is available through the repository in our Github organization:

    Severity

    Description

    Critical
    Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

    High
    High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

    Medium
    Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

    Low
    Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
    • Severity

      Critical

      Description

      Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

      Severity

      High

      Description

      High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

      Severity

      Medium

      Description

      Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

      Severity

      Low

      Description

      Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.

    Appendix 2. Scope

    The scope of the project includes the following smart contracts from the provided repository:

    Scope Details

    Repositoryhttps://github.com/neptune-mutual-blue/periphery/
    Commite90464d07b425f5f1a85959e1c196a0a8ae43282
    WhitepaperNot provided
    RequirementsProvided
    Technical RequirementsProvided

    Contracts in Scope

    LiquidityGaugePool.sol - LiquidityGaugePool.sol
    LiquidityGaugePoolController.sol - LiquidityGaugePoolController.sol
    LiquidityGaugePoolReward.sol - LiquidityGaugePoolReward.sol
    LiquidityGaugePoolState.sol - LiquidityGaugePoolState.sol
    interfaces
    ILiquidityGaugePool.sol - interfaces/ILiquidityGaugePool.sol

    Disclaimer