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

Audit name:

[SCA] Offblocks | Escrow | Mar2024

Date:

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

OffBlocks is a hybrid platform for digital assets spending, helps wallet and DeFi companies offer trustless crypto-to-fiat experiences as well as payments and card services.

titlecontent
PlatformEVM
LanguageSolidity
TagsEscrow, Smart Wallet, Factory
Timeline22/03/2024 -  19/04/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/OffBlocks/offblocks-contracts→
    Commitfef94ee4963c49d53c7d217cd6e3e7d5860ec9c3

    Audit Summary

    Total9.3/10
    Security Score

    10/10

    Test Coverage

    80.24%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    12Total Findings
    11Resolved
    1Accepted
    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 OffBlocks
    Audited ByNiccolò Pozzolini, Kornel Światłowski
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.offblocks.xyz/→
    Changelog27/03/2024 - Preliminary Report
    19/04/2024 - Final Report
    • Document

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

    System Overview

    OffBlocksEscrow - contract handles token deposits and withdrawals coming from smart wallets, specifically designed for the OffBlocks platform. It supports deposit operations, deposit status updates, withdrawals for rejected deposits, and settlement of approved deposits.

    OffBlocksSmartWalletFactory - factory contract for OffBlocks smart wallets. Contract owner can also register and unregister third-party smart wallets that will be allowed to interact with the OffBlocksEscrow contract.

    OffBlocksSmartWallet - smart wallet contract deployed within OffBlocksSmartWalletFactory.

    PendingWithdrawal - helper contract linked deployed during the creation of each OffBlocksSmartWallet. It manages the withdrawal of tokens from OffBlocksSmartWallet after a declared delay.

    Privileged roles

    Owner of OffBlocksEscrow can:

    • Adds and removes a token to the list of supported tokens.

    • Updates the address of the OffBlocks smart wallet factory contract.

    • Reduces the amount of the given deposit.

    • Batch updates the statuses of the deposits.

    • Withdraws the rejected deposit from the escrow to the depositor.

    • Transfers the approved deposit from the escrow to the settlement wallet.

    • Pause and unpause contract.

    • Rescues ERC20 tokens sent to the contract by mistake.

    Owner of OffBlocksSmartWallet can:

    • Initiates a token withdrawal.

    • Claims the token withdrawal.

    Owner of OffBlocksSmartWalletFactory can:

    • Creates a new OffBlocks smart wallet.

    • Changes the withdrawal delay.

    • Registers and unregisters multiple third-party smart wallets.

    • Rescues ERC20 tokens sent to the contract by mistake.

    Owner of PendingWithdrawal can:

    • Initiates a token withdrawal.

    • Claims the token withdrawal.

    • Cancels withdrawal of a token.

    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.

    Test coverage

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

    • Negative cases coverage is missed.

    Security score

    Upon auditing, the code was found to contain 1 critical, 0 high, 3 medium, and 0 low severity issues. All issues have been 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.3. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    No additional risks were identified.

    Findings

    F-2024-1722The batchUpdateDepositStatuses function does not updates statuses
    Status
    fixed
    Severity

    Critical
    F-2024-1743Unchecked transfers of ERC20 tokens
    Status
    fixed
    Severity

    Medium
    F-2024-1736Lack of deposit status update in reject and settle functions
    Status
    fixed
    Severity

    Medium
    F-2024-1695The rescueTokens functionn allows owner to drain all tokens from escrow
    Status
    fixed
    Severity

    Medium
    F-2024-1779Unnecessary external call in the smartWalletOwner function
    Status
    fixed
    Severity

    Observation
    F-2024-1750Missing two-step ownership transfer process
    Status
    fixed
    Severity

    Observation
    F-2024-1744Gas usage of updating Deposit struct can be optimized
    Status
    fixed
    Severity

    Observation
    F-2024-1741Redundant getters in OffBlocksSmartWalletFactory.sol
    Status
    fixed
    Severity

    Observation
    F-2024-1740PendingWithdrawal only supports one withdrawal per token at a time
    Status
    accepted
    Severity

    Observation
    F-2024-1737Unoptimized gas consumption in _checkForInvalidAddress function
    Status
    fixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2024-1722The batchUpdateDepositStatuses function does not updates statuses
    fixed

    Critical
    F-2024-1743Unchecked transfers of ERC20 tokens
    fixed

    Medium
    F-2024-1736Lack of deposit status update in reject and settle functions
    fixed

    Medium
    F-2024-1695The rescueTokens functionn allows owner to drain all tokens from escrow
    fixed

    Medium
    F-2024-1779Unnecessary external call in the smartWalletOwner function
    fixed

    Observation
    F-2024-1750Missing two-step ownership transfer process
    fixed

    Observation
    F-2024-1744Gas usage of updating Deposit struct can be optimized
    fixed

    Observation
    F-2024-1741Redundant getters in OffBlocksSmartWalletFactory.sol
    fixed

    Observation
    F-2024-1740PendingWithdrawal only supports one withdrawal per token at a time
    accepted

    Observation
    F-2024-1737Unoptimized gas consumption in _checkForInvalidAddress function
    fixed

    Observation
    1-10 of 12 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
    core
    OffBlocksEscrow.sol - contracts › core › OffBlocksEscrow.sol
    OffBlocksSmartWallet.sol - contracts › core › OffBlocksSmartWallet.sol
    OffBlocksSmartWalletFactory.sol - contracts › core › OffBlocksSmartWalletFactory.sol
    PendingWithdrawal.sol - contracts › core › PendingWithdrawal.sol
    interfaces
    IOffBlocksEscrow.sol - contracts › interfaces › IOffBlocksEscrow.sol
    IOffBlocksSmartWalletFactory.sol - contracts › interfaces › IOffBlocksSmartWalletFactory.sol
    IOffBlocksSmartWallet.sol - contracts › interfaces › IOffBlocksSmartWallet.sol

    Disclaimer