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.
title | content |
---|---|
Platform | Aptos |
Language | Move |
Tags | Staking, Incentives |
Timeline | 09.02.2024 - 20.02.2024 |
Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
---|---|
Repository | https://github.com/Propbase-Application/propbase_staking_blockchain→ |
Commit | 52f4bf6 |
Review Scope
- Commit
- 52f4bf6
Audit Summary
10/10
96%
8/10
7/10
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 | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for Propbase |
Audited By | Ataberk Yavuzer, Vladyslav Khomenko |
Approved By | Przemyslaw Swiatowiec |
Website | https://www.propbase.app/→ |
Changelog | 20.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
- Website
- https://www.propbase.app/→
- 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-0826 | Early withdrawal penalty bypass by chunking withdrawal amount | fixed | Medium | |
F-2024-0962 | Centralized emergency withdrawal functionality | mitigated | Low | |
F-2024-0934 | Underconfigured state is possible | fixed | Low | |
F-2024-0917 | Rewarding formula inconsistency between the documentation and the code | fixed | Low | |
F-2024-0916 | Users with low stake amounts cannot get any rewards due to precision loss | fixed | Low | |
F-2024-0915 | Unnecessary calculations for old stakeholders | fixed | Low | |
F-2024-0935 | Literal value is used | fixed | Observation | |
F-2024-0933 | Using deprecated events type | fixed | Observation | |
F-2024-0921 | Unknown upgrade policy | fixed | Observation | |
F-2024-0920 | Too generic assertion errors | fixed | Observation |
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 | |
---|---|
Repository | https://github.com/Propbase-Application/propbase_staking_blockchain→ |
Commit | a81b2c998a43b164083917ff9c08073fc4372acc |
Remediation Commit | 9416b9a04f7109cc40ef9ad586dfc385d8932f08 |
Whitepaper | README.md→ |
Requirements | README.md→ |
Technical Requirements | README.md→ |
Scope Details
- Commit
- a81b2c998a43b164083917ff9c08073fc4372acc
- Remediation Commit
- 9416b9a04f7109cc40ef9ad586dfc385d8932f08
- Whitepaper
- README.md→
- Requirements
- README.md→
- Technical Requirements
- README.md→