Q1 2025 Web3 Security ReportAccess control failures led to $1.63 billion in losses
Discover report insights
  • Hacken
  • Audits
  • propbase
  • [SCA] Propbase / Staking / Feb2024
Propbase logo

Propbase

Audit name:

[SCA] Propbase / Staking / Feb2024

Date:

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

The PROPS Staking App facilitates the staking of $PROPS, providing users with additional $PROPS as rewards. Developed using the Move language and Aptos standard libraries, the application operates on the Aptos blockchain.

titlecontent
PlatformAptos
LanguageMove
TagsStaking, Incentives
Timeline09.02.2024 - 20.02.2024
Methodologyhttps://hackenio.cc/sc_methodology

    Audit Summary

    Total9.1/10
    Security Score

    10/10

    Test Coverage

    96%

    Code Quality Score

    8/10

    Documentation Quality Score

    7/10

    10Total Findings
    9Resolved
    0Accepted
    1Mitigated

    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 Propbase
    Audited ByAtaberk Yavuzer, Vladyslav Khomenko
    Approved ByPrzemyslaw Swiatowiec
    Websitehttps://www.propbase.app/
    Changelog20.02.2024 - Preliminary Report, 06.03.2024 - Final Report
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Propbase
      Audited By
      Ataberk Yavuzer, Vladyslav Khomenko
      Approved By
      Przemyslaw Swiatowiec
      Changelog
      20.02.2024 - Preliminary Report, 06.03.2024 - Final Report

    System Overview

    PROPS is a staking protocol with the following contracts:

    propbase_staking.move  — a smart contract that rewards users for staking their tokens. Reward distribution depends on the max pool cap provided by the owner and could not be re-calculated after staking epoch is started. It was planned that this contract is going to use the $PROPS token (8 decimals) as its main crypto asset. Users can stake their $PROPS token right after the staking epoch is getting started. They can stake until 1 day before epoch end time to benefit from protocol rewards. There are multiple feature of this contract. There will be a total reward amount in the protocol. If the entire reward amount cannot distributed to protocol users, the excessive amount will be stored in the pool until default expiry time passes which is 2 years by default. After that time, the treasury role of the protocol can withdraw the excessive rewards. Also, the owner can freeze the contract in case of emergency by calling the emergency stop functionality. Protocol rewards and stakes can be directly transferred to protocol users by owner if the protocol goes into the emergency stage.

    Privileged roles

    • Admin:

      • stops staking operations in case of emergency

      • updates admin, reward treasurer and treasury addresses

      • creates or updates a staking pool

      • transfer stakes and rewards back in case of emergency

    • Treasury:

      • withdraws excess rewards

      • calculates required rewards

      • receives early withdrawal penalties

    • Reward treasurer:

      • adds reward funds to the protocol

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 7 out of 10.

    • Documentation contains all information about the protocol itself.

    • Functional requirements are provided.

    • Technical description are provided.

    • There is a minor discrepancy between the documentation and code.

    Code quality

    The total Code Quality score is 8 out of 10.

    • Event emitting method in the code is deprecated.

    • Check-effect-interaction pattern is correctly covered.

    • The state management is implemented correctly.

    Test coverage

    Code coverage of the project is 96%.

    • Deployment and basic user interactions are covered with tests.

    • Test cases covers most of possible scenarios.

    • Interactions by several users are tested thoroughly.

    Security score

    Upon auditing, the code was found to contain 0 critical, 0 high, 1 medium, and 5 low severity issues, leading to a security score of 9 out of 10.

    After fixing all findings, the security score is reached to 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.1. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    Admin can freeze the protocol at any time.

    There are multiple instances of precision losses.

    Early withdrawal penalties can be bypassed.

    The emergency_asset_distribution() function is only callable by admin. This function is designed to send tokens back to users during an emergency situation. Therefore, other users should be able to call this function too.

    PROPS token was not audited since it was not included in the audit scope. Therefore, it is impossible to ensure the PROPS token is secure.

    Findings

    Code
    Title
    Status
    Severity
    F-2024-0826Early withdrawal penalty bypass by chunking withdrawal amount
    fixed

    Medium
    F-2024-0962Centralized emergency withdrawal functionality
    mitigated

    Low
    F-2024-0934Underconfigured state is possible
    fixed

    Low
    F-2024-0917Rewarding formula inconsistency between the documentation and the code
    fixed

    Low
    F-2024-0916Users with low stake amounts cannot get any rewards due to precision loss
    fixed

    Low
    F-2024-0915Unnecessary calculations for old stakeholders
    fixed

    Low
    F-2024-0935Literal value is used
    fixed

    Observation
    F-2024-0933Using deprecated events type
    fixed

    Observation
    F-2024-0921Unknown upgrade policy
    fixed

    Observation
    F-2024-0920Too generic assertion errors
    fixed

    Observation
    1-10 of 10 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/Propbase-Application/propbase_staking_blockchain
    Commita81b2c998a43b164083917ff9c08073fc4372acc
    Remediation Commit9416b9a04f7109cc40ef9ad586dfc385d8932f08
    WhitepaperREADME.md
    RequirementsREADME.md
    Technical RequirementsREADME.md

    Contracts in Scope

    sources
    propbase_staking.move - sources/propbase_staking.move

    Disclaimer