Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] JuicyPerp | Marketplace | Mar2024

Date:

Apr 17, 2024

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 JuicyPerp team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

titlecontent
PlatformEVM
LanguageSolidity
TagsERC721, Marketplace
Timeline27/03/2024 - 09/04/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/juicyperp/contracts→
    Commitf0dc232490682dc1caec4d53fb988195ae4dcd63

    Audit Summary

    Total9.9/10
    Security Score

    10/10

    Test Coverage

    97.86%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    11Total Findings
    11Resolved
    0Accepted
    0Mitigated

    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 JuicyPerp
    Audited ByNiccolò Pozzolini, Kornel Światłowski
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.juicyperp.xyz/→
    Changelog03/04/2024 - Preliminary Report
    09/04/2024 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for JuicyPerp
      Audited By
      Niccolò Pozzolini, Kornel Światłowski
      Approved By
      Przemyslaw Swiatowiec
      Changelog
      03/04/2024 - Preliminary Report
      09/04/2024 - Second Review

    System Overview

    JuicyPerp is a peer-to-pool based options protocol for NFT floor and other asset prices. It lets users speculate on the price development of various asset pairs in a digital option style, where users that make the correct prediction about the price development of the underlying asset win all the liquidity of the loosing side.

    Privileged roles

    The Pool.sol contract implements OpenZeppelin’s AccessControl.sol library and uses following roles:

    • SUPER_ADMIN: This role is the super administrator of the contract. He has authority over the OWNER role. This role belongs to a multi signature wallet that is set at contract deployment. The holder of this role is unable to renounce it and is immutable.

    • OWNER: This role is able to change critical workings of the contract, like changing fee structures, setting pool templates, and managing the POOL_CREATOR role.

    • POOL_CREATOR: Holders of this role are able to create custom battle pools.

    • WHITE_LISTER: Holders of this role can whitelist wallets to enter battles.

    The Marketplace.sol contract implements OpenZeppelin’s AccessControl.sol library and uses following roles:

    • SUPERADMIN: This role is the super administrator of the contract. He has authority over the OWNER role. This role belongs to a multi signature wallet that is set at contract deployment. The holder of this role is unable to renounce it and is immutable. The SUPERADMIN has authority to set the treasury address of the contract.

    • OWNER: This role is able to change the fee structure of the marketplace.

    The FloorPriceOracleMultisig.sol contract implements OpenZeppelin’s AccessControl.sol library and uses following roles:

    • SUPERADMIN: This role is the super administrator of the contract. He has authority over the SIGNER role. This role belongs to a multi signature wallet that is set at contract deployment. The holder of this role is unable to renounce it and is immutable. The SUPERADMIN is also able to set the number of required signatures that are needed for a price change to become effective in the oracle.

    • SIGNER: This role is able make oracle update suggestions and sign update suggestions other SIGNERS suggested.

    The PricingRouter.sol contract implements OpenZeppelin’s AccessControl.sol library and uses following roles:

    • SUPER_ADMIN: This role is the super administrator of the contract. He has authority over the OWNER role. This role belongs to a multi signature wallet that is set at contract deployment. The holder of this role is unable to renounce it and is immutable.

    • OWNER: This role is able to change the routing from the pool contract to the oracle contracts.

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 10 out of 10.

    • Functional requirements are complete.

    • Technical description is provided.

    Code quality

    The total Code Quality score is 10 out of 10.

    • The development environment is configured.

    Test coverage

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

    • Negative cases coverage is present.

    • Deployment and basic user interactions are covered with tests.

    Security score

    Upon auditing, the code was found to contain 0 critical, 0 high, 1 medium, and 2 low severity issues. After the remediation part of the audit process, all issues were fixed 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.9. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Dependency on External Logic for Implemented Logic: The implemented Pyth oracle logic highly depends on external contracts not covered by the audit. This reliance introduces risks if these external contracts are compromised or contain vulnerabilities, affecting the audited project's integrity.

    Findings

    F-2024-1913Missing stale price check in getLatestPrice function
    Status
    fixed
    Severity

    Medium
    F-2024-1942Overpermissive approval check in createListing function
    Status
    fixed
    Severity

    Low
    F-2024-1912Missing bounds check in setRequiredSignatures function
    Status
    fixed
    Severity

    Low
    F-2024-1974Checks-Effects-Interactions pattern violation
    Status
    fixed
    Severity

    Observation
    F-2024-1946Contract name mismatch
    Status
    fixed
    Severity

    Observation
    F-2024-1941Missing Zero Address Check in setTreasury Function
    Status
    fixed
    Severity

    Observation
    F-2024-1940battleContract and poolContract should be declared as immutable in Marketplace.sol
    Status
    fixed
    Severity

    Observation
    F-2024-1911Update event is missing the candidate index
    Status
    fixed
    Severity

    Observation
    F-2024-1909Missing events in whitelist modification functions
    Status
    fixed
    Severity

    Observation
    F-2024-1908Incorrect condition in returnFee function
    Status
    fixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2024-1913Missing stale price check in getLatestPrice function
    fixed

    Medium
    F-2024-1942Overpermissive approval check in createListing function
    fixed

    Low
    F-2024-1912Missing bounds check in setRequiredSignatures function
    fixed

    Low
    F-2024-1974Checks-Effects-Interactions pattern violation
    fixed

    Observation
    F-2024-1946Contract name mismatch
    fixed

    Observation
    F-2024-1941Missing Zero Address Check in setTreasury Function
    fixed

    Observation
    F-2024-1940battleContract and poolContract should be declared as immutable in Marketplace.sol
    fixed

    Observation
    F-2024-1911Update event is missing the candidate index
    fixed

    Observation
    F-2024-1909Missing events in whitelist modification functions
    fixed

    Observation
    F-2024-1908Incorrect condition in returnFee function
    fixed

    Observation
    1-10 of 11 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:

    Contracts in Scope

    contracts
    Battle.sol - contracts › Battle.sol
    FloorPriceOracleMultisig.sol - contracts › FloorPriceOracleMultisig.sol
    Marketplace.sol - contracts › Marketplace.sol
    Pool.sol.sol - contracts › Pool.sol.sol
    PricingRouter.sol - contracts › PricingRouter.sol
    PricingService.sol - contracts › PricingService.sol

    Disclaimer