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

Audit name:

[SCA] Blocksquare | Distribution | Jan2024

Date:

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

The Blocksquare Revenue Distribution System is an innovative smart contract ecosystem, specifically designed for managing and distributing revenue in a property management or real estate investment context.

titlecontent
PlatformEVM
LanguageSolidity
TagsAirdrop; Proxy; Upgradable
Timeline24/01/2024 - 20/02/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Audit Summary

    Total9.9/10
    Security Score

    10/10

    Test Coverage

    96.15%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    13Total Findings
    13Resolved
    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 BlockSquare
    Audited ByIvan Bondar
    Approved ByGrzegorz Trawinski
    Websitehttps://blocksquare.io/→
    Changelog26/01/2024 - Preliminary Report
    20/02/2024 - Final Report
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for BlockSquare
      Audited By
      Ivan Bondar
      Approved By
      Grzegorz Trawinski
      Changelog
      26/01/2024 - Preliminary Report
      20/02/2024 - Final Report

    System Overview

    The Blocksquare Revenue Distribution System is an innovative smart contract ecosystem built on Ethereum, specifically designed for managing and distributing revenue in a property management or real estate investment context. It centralizes the revenue management process for property-related investments, offering a transparent and efficient way to handle revenue distributions and claims.

    The files in the scope:

    • RevenueDistribution.sol - this contract is central to the system, facilitating various functionalities:

      • Revenue Tracking and Distribution:

        • Manages revenue associated with different properties (PropTokens).

        • Tracks individual and total revenue amounts for properties and users.

        • Enables the addition of revenue for properties and its distribution among multiple users.

      • Revenue Claiming:

        • Provides functions for users to claim revenue for specific properties or multiple properties.

        • Supports claiming for individual and multiple wallets.

      • Data and Token Integration:

        • Interacts with external contracts/interfaces indicated by data (for permissions) and tokenAddress (for token transfers).

    • RevenueDistributionProxy.sol - a Transparent Upgradeable Proxy that serves as a flexible and upgradable front for the RevenueDistribution contract

    Privileged roles

    • RevenueDistribution:

      • Contract Owner:

        • Has the authority to transfer ownership and renounce ownership.

        • Can update the data proxy (_data) address, affecting the system's core functionalities.

      • Authorized Users:

        • Users with special permissions (verified through the _data contract) can add revenue to the system.

        • This role is restricted to system administrators or trusted community partners.

    • RevenueDistributionProxy:

      • Proxy Admin:

        • Responsible for managing and executing upgrades to the RevenueDistribution contract.

        • Holds significant power over the proxy contract, with the ability to change the business logic address (logic) and initialize new logic contracts.

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 10 out of 10.

    • Functional requirements have some gaps:

      • Project overview is detailed

      • The roles within the system are described.

      • Use cases are described and detailed.

      • For each contract all futures are described

      • All interactions are described.

    • Technical description is robust:

      • Run instructions are provided.

      • Technical specification is provided.

      • NatSpec is sufficient.

    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 96.15% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • Negative cases coverage is present.

    • Interactions by several users are tested.

    Security score

    Upon auditing, the code was found to contain 0 critical, 0 high, 2 medium, and 2 low severity issues. All issues were fixed in the remediation part of this audit, 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

    Upgradability and Future Version Modifications: The contract's upgradable nature means that its implementation can be modified in future versions. This flexibility allows for necessary updates and improvements but also introduces uncertainty for users regarding future changes in the contract's behavior and rules. Users should stay informed about any contract upgrades and understand their implications.

    Criticality of Accurate Revenue Allocation in addRevenue Function: The addRevenue function plays a crucial role in distributing revenues accurately among users. It requires precise input parameters to ensure fair and correct allocation. Incorrect or manipulated inputs can lead to improper revenue distribution, affecting the trust and fairness of the system. Users and community partners must exercise due diligence in verifying the accuracy of the input data.

    Changeability of Access Control via RevenueDistributionHelpers _data: The contract allows for the modification of the RevenueDistributionHelpers _data, which controls access permissions, particularly for the addRevenue function. Changes to this helper can alter who has the authority to distribute revenues, potentially impacting the consistency and integrity of revenue allocations. Users should be aware of any changes to these access controls and understand their potential impact on revenue distribution practices.

    Solidity Version Compatibility and Cross-Chain Deployment: 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.

    Findings

    F-2024-0583Token Address Alteration in Revenue Distribution Contract
    Status
    fixed
    Severity

    Medium
    F-2024-0579Incompatibility with Non-Standard ERC20 Token Interfaces
    Status
    fixed
    Severity

    Medium
    F-2024-0575Checks-Effects-Interactions Pattern Violation
    Status
    fixed
    Severity

    Low
    F-2024-0570Inadequate Constructor Initialization in Upgradeable Contract
    Status
    fixed
    Severity

    Low
    F-2024-0591SPDX License Identifier
    Status
    fixed
    Severity

    Observation
    F-2024-0582Unnecessary Revenue Transfer for Zero Amount
    Status
    fixed
    Severity

    Observation
    F-2024-0580Redundant Zero Address Check in Contract Initialization
    Status
    fixed
    Severity

    Observation
    F-2024-0576Missing checks for address(0)
    Status
    fixed
    Severity

    Observation
    F-2024-0574Public Functions That Should Be External
    Status
    fixed
    Severity

    Observation
    F-2024-0573Function Parameter "owner" Shadows Function owner() from OwnableUpgradeable Contract
    Status
    fixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2024-0583Token Address Alteration in Revenue Distribution Contract
    fixed

    Medium
    F-2024-0579Incompatibility with Non-Standard ERC20 Token Interfaces
    fixed

    Medium
    F-2024-0575Checks-Effects-Interactions Pattern Violation
    fixed

    Low
    F-2024-0570Inadequate Constructor Initialization in Upgradeable Contract
    fixed

    Low
    F-2024-0591SPDX License Identifier
    fixed

    Observation
    F-2024-0582Unnecessary Revenue Transfer for Zero Amount
    fixed

    Observation
    F-2024-0580Redundant Zero Address Check in Contract Initialization
    fixed

    Observation
    F-2024-0576Missing checks for address(0)
    fixed

    Observation
    F-2024-0574Public Functions That Should Be External
    fixed

    Observation
    F-2024-0573Function Parameter "owner" Shadows Function owner() from OwnableUpgradeable Contract
    fixed

    Observation
    1-10 of 13 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/blocksquare/blocksquare-contracts→
    Commitdbb42e8598c4c03d0879f4c7f03c5f717b613ba0
    WhitepaperN/A
    RequirementsNatSpec
    Technical Requirementshttps://docs.blocksquare.io/for-developers/revenue-distribution-contract→

    Contracts in Scope

    RevenueDistribution.sol - RevenueDistribution.sol
    RevenueDistributionProxy.sol - RevenueDistributionProxy.sol

    Disclaimer