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

Audit name:

[SCA] Galileo Protocol | Marketplace + Escrow | Feb2024

Date:

Apr 30, 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 Galileo Protocol team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

titlecontent
PlatformEVM
LanguageSolidity.
TagsERC721, Marketplace, RWA.
Timeline08/04/2024 - 29/04/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/Galileo-Protocol-io/Galileo_Contracts→
    Commit8f73fe8c79aae71c0ede587abbd1689a963e6144

    Audit Summary

    Total9.4/10
    Security Score

    10/10

    Test Coverage

    87.31%

    Code Quality Score

    10/10

    Documentation Quality Score

    9/10

    38Total Findings
    33Resolved
    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 Galileo Protocol
    Audited ByCarlo Parisi, Viktor Raboshchuk
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.galileoprotocol.io/→
    Changelog14/03/2024 - Preliminary Report
    05/04/2024 - Final Report
    15/04/2024 - Re-Audit
    29/04/2024 - Final Report
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Galileo Protocol
      Audited By
      Carlo Parisi, Viktor Raboshchuk
      Approved By
      Przemyslaw Swiatowiec
      Changelog
      14/03/2024 - Preliminary Report
      05/04/2024 - Final Report
      15/04/2024 - Re-Audit
      29/04/2024 - Final Report

    System Overview

    The Galileo Protocol is a tokenisation platform that aims to revolutionise the authentication and ownership of luxury goods and real-world assets. The protocol has following contracts:

    The GalileoEscrow - smart contract designed to handle escrow functionality for the Galileo Protocol marketplace. It utilizes OpenZeppelin contracts for access control, reentrancy protection, and ERC-721 and ERC-20 token standards. The contract allows users to submit and manage disputes related to the purchase of non-fungible tokens (NFTs) on the Galileo Protocol platform and fund distribution in a decentralized manner.

    GalileoFactory - smart contract employees OpenZeppelin libraries for access control and upgradeability, serving as a factory for deploying and managing instances of the "GalileoProtocol" contract. The contract tracks and updates the total deployed GalileoProtocols smart contracts, manages a mapping associating serial numbers with contract addresses and token IDs, and enforces the uniqueness of initials against each NFT of the collection.

    GalileoMarketplace - The Galileo Marketplace is a decentralized marketplace smart contract. The contract facilitates NFTs' listing, buying, and reselling, integrating features such as royalties, referral fees, and flexible pricing. Users can create and list NFTs for sale, and buyers can purchase them with a flexible pricing structure that includes fees for royalties, referrals, and marketplace fees. The contract also supports the redemption of NFTs and provides functionality for adjusting prices, changing fees, and managing the marketplace address. The contract incorporates access control, EIP-712 for structured domain-specific data, and various OpenZeppelin libraries for security and upgradability. The Galileo Marketplace aims to provide a versatile and secure platform for NFT transactions.

    GalileoProtocol - smart contract is an Ethereum-based NFT protocol. It inherits from several OpenZeppelin libraries, including ERC721URIStorage for NFT functionality, AccessControl for role-based access control, and EIP712 for signature verification. The contract introduces a unique minting mechanism where sub-admins can mint NFTs, pay minting fees in ERC20 tokens, and transfer ownership of the minted NFTs. The contract also supports bulk minting and URI updates, a lazy minting feature that involves signed vouchers for NFT purchases, and a dynamic fee structure for minting operations.

    interfaces/IEscrow.sol -  Interface for the Escrow contract.

    interfaces/IFactory.sol - Interface for the Factory contract.

    interfaces/IMarket.sol - Interface for the Market contract.

    interfaces/IProtocol.sol - Interface for the Protocol contract.

    lib/GalileoRoyalties.sol - smart contract serves as a utility contract that facilitates the management of royalty data associated with non-fungible tokens. It introduces a DataStruct that includes arrays for addresses and corresponding royalty percentages, along with an overall royalty amount. The addData function allows users to input and update royalty-related information for a specific NFT, associating addresses with their respective royalty percentages. The getData function retrieves this stored data for a given NFT. The contract provides a flexible and organized way to handle royalty information, which can be utilized by the main GalileoMarketplace contract for transparent and customizable royalty distribution among NFT stakeholders.

    lib/ReferralStruct.sol - smart contract that contains ReferralParameters solidity structure type.

    Privileged roles

    • GalileoEscrow

      • ESCROWMANAGERROLE: Manages the escrow process, including dispute resolution.

      • ADMIN_ROLE: Administers the contract, making decisions on disputes, and withdrawing funds.

      • MARKETPLACE_ROLE: Assigned to the Galileo Marketplace contract, allowing it to configure collections and add asset data.

    • GalileoFactory

      • DEFAULTADMINROLE - default admin role for all roles. Can deploy the new smart contract.

      • ASSIGN_ROLE - can update serial number and serial mapping

    • GalileoMarketplace

      • SUBADMINROLE - can change the fee of the marketplace, and change the address of the one who received a fee.

      • VALIDATOR_ROLE -  able to purchase auto redeem of multiple items, buy multiple NFTs, and to redeem pNFT.

      • SUPERADMINROLE - able to set the address of galileo escrow contract.

    • GalileoProtocol

      • SUBADMINROLE - can mint NFT, mint NFT to a specific user address, mint multiple tokens in a single transaction, can purchase NFTs using vouchers. Can set the value of referral bool to true or false.

      • SUPERADMINROLE - can set the referral fee for a specified price range.

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 9 out of 10.

    • Functional requirements are mostly provided.

    • Technical description is provided.

    • NatSpec is provided.

    Code quality

    The total Code Quality score is 10 out of 10.

    Test coverage

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

    • Deployment and basic user interactions are covered with tests.

    Security score

    Upon auditing, the code was found to contain 9 critical, 5 high, 3 medium, and 4 low severity issues. All issues were fixed, leading to a security score of 0 out of 10, upon performing the remediation check, every issue was found to have been resolved, the code contains 0 critical, 0 high, 0 medium and 0 low severity issues, 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.4. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    The project utilizes Solidity version 0.8.20 or higher, which includes the introduction of the PUSH0 (0x5f) opcode. This opcode is currently supported on the Ethereum mainnet but may not be universally supported across other blockchain networks. Consequently, deploying the contract on chains other than the Ethereum mainnet, such as certain Layer 2 (L2) chains or alternative networks, might lead to compatibility issues or execution errors due to the lack of support for the PUSH0 opcode. In scenarios where deployment on various chains is anticipated, selecting an appropriate Ethereum Virtual Machine (EVM) version that is widely supported across these networks is crucial to avoid potential operational disruptions or deployment failures.

    In the GalileoProtocol contract, SUBADMINROLE can mint an unrestricted amount of NFTs.

    The admin can change the URI of any NFT and burn specific token ID. This could potentially allow the owner to change the URI of the NFT or destroy NFTs they do not own, resulting in substantial losses for the rightful owners of the NFTs.

    The admin role of the GalileoMarketplace contract can withdraw user funds.

    The require statements for referFee, royaltyAmount, feePercent, and the fee amount in setReferralFees are checked for a high fee value equal to 100%, meaning that fees can be set to excessively high values.

    The protocol contains multiple violations of the CEI (Check-Effect-Interact) pattern, which can lead to a known attack vector in Solidity called a "reentrancy attack." In this attack, a malicious actor can exploit the call to an external contract to re-enter and manipulate the calling contract.

    processAssetsQuery and processAssetsUpdate could potentially facilitate a Denial of Service attack if the length of the array _assets.tokenIds is too big of a number.

    In the function makeDecision of the contract GalileoEscrow transfers of tokens are made without checking the return value of those transfers.

    Findings

    F-2024-1639Skipping elements in for loop
    Status
    fixed
    Severity

    Critical
    F-2024-2110Inability to redeem NFTs bought with buyNFT function
    Status
    mitigated
    Severity

    Critical
    F-2024-2109Inability to list NFTs minted with mintTo function on GalileoMarketplace
    Status
    mitigated
    Severity

    Critical
    F-2024-2107Potential for frontrunning in _recover function
    Status
    fixed
    Severity

    Critical
    F-2024-2096Lost shipment fee in NFT purchase
    Status
    fixed
    Severity

    Critical
    F-2024-2048Unnecessary token id validation
    Status
    fixed
    Severity

    Critical
    F-2024-1469Unauthorized listing of NFTs
    Status
    fixed
    Severity

    Critical
    F-2024-1452Incorrect royalty calculation for multiple NFTs
    Status
    fixed
    Severity

    Critical
    F-2024-1451User pay tax twice in _buyNFT function
    Status
    fixed
    Severity

    Critical
    F-2024-2106Inconsistent state in redeem function of GalileoMarketplace contract
    Status
    fixed
    Severity

    High
    Code
    ―
    Title
    Status
    Severity
    F-2024-1639Skipping elements in for loop
    fixed

    Critical
    F-2024-2110Inability to redeem NFTs bought with buyNFT function
    mitigated

    Critical
    F-2024-2109Inability to list NFTs minted with mintTo function on GalileoMarketplace
    mitigated

    Critical
    F-2024-2107Potential for frontrunning in _recover function
    fixed

    Critical
    F-2024-2096Lost shipment fee in NFT purchase
    fixed

    Critical
    F-2024-2048Unnecessary token id validation
    fixed

    Critical
    F-2024-1469Unauthorized listing of NFTs
    fixed

    Critical
    F-2024-1452Incorrect royalty calculation for multiple NFTs
    fixed

    Critical
    F-2024-1451User pay tax twice in _buyNFT function
    fixed

    Critical
    F-2024-2106Inconsistent state in redeem function of GalileoMarketplace contract
    fixed

    High
    1-10 of 38 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/Galileo-Protocol-io/Galileo_Contracts→
    Commit8f73fe8c79aae71c0ede587abbd1689a963e6144
    Whitepaper
    RequirementsDetail Document of Functionality.docs
    Technical RequirementsDetail Document of Functionality.docs

    Contracts in Scope

    contracts
    GalileoFactory.sol - contracts › GalileoFactory.sol
    GalileoMarketplace.sol - contracts › GalileoMarketplace.sol
    GalileoEscrow.sol - contracts › GalileoEscrow.sol
    GalileoProtocol.sol - contracts › GalileoProtocol.sol
    interfaces
    IFactory.sol - contracts › interfaces › IFactory.sol
    IMarket.sol - contracts › interfaces › IMarket.sol
    IProtocol.sol - contracts › interfaces › IProtocol.sol
    IEscrow.sol - contracts › interfaces › IEscrow.sol
    lib
    ReferralStruct.sol - lib › ReferralStruct.sol
    GalileoRoyalties.sol - lib › GalileoRoyalties.sol

    Disclaimer