Introduction
We express our gratitude to the Optimus.ventures team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Optimus Ventures is a staking project that takes and rewards ERC20, which generates an ERC721 token for its users as a pinkslip.
| title | content |
|---|---|
| Platform | BNB Chain |
| Language | Solidity |
| Tags | ERC20 token, Staking, ERC721 token |
| Timeline | 20/03/2023 - 17/05/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/OptimusVentures/HODLAudit→ |
| Commit | c6cd38fbea2aafbe346de04010f6dbc77aa301a0 |
Review Scope
- Commit
- c6cd38fbea2aafbe346de04010f6dbc77aa301a0
Audit Summary
10/10
94.80%
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 Optimus.ventures |
| Audited By | Hacken |
| Changelog | 24/03/2023 – Initial Review |
| 19/04/2023 - Second Review | |
| 03/05/2023 - Third Review | |
| 17/05/2023 - Fourth Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Optimus.ventures
- Audited By
- Hacken
- Changelog
- 24/03/2023 – Initial Review
- 19/04/2023 - Second Review
- 03/05/2023 - Third Review
- 17/05/2023 - Fourth Review
System Overview
Optimus Ventures is a staking project that takes and rewards ERC20, which generates an ERC721 token for its users as a pinkslip. The project contains the following contracts:
HODLStakingFactory — HODL ERC20 staking pools, farms and manages ownership and control over it.
HODLStaking — HODL staking pool contract, to stake ERC20 tokens with a dynamic APY.
HODLBase — contains structs and global variables.
HODLCoreNFT - The HODLCoreNFT contract is a ERC721 token (NFT) collection representing HODL staking positions. It also provides royalty payments to a specified address.
Privileged roles
The owner of the HODLStakingFactory contract has the authority to pause/unpause the contract. They may also set the coreNFT, pool master contract, pool creation payment token address, project fee, minimum staking period, pool creation price, and pool fee ranges.
The onlyProjectWallet role of the HODLStaking contract is responsible for pausing/unpausing the contract, initiating the staking period after the deposit time has elapsed, and in the event of an emergency, terminating the contract and withdrawing any unearned rewards.
The onlyOwner role of the HODLStaking contract is tasked with halting user fund deposits via the setDepositable function.
The owner role of the HODLCoreNFT contract has the authority to set URI to any token ID.
The minter role within the HODLCoreNFT contract is capable of minting new tokens and adding new minter addresses to the system.
Executive Summary
Documentation quality
The total Documentation quality score is 7 out of 10.
Functional requirements are partially provided.
Use cases and business logic are missing.
Technical description is provided.
Code quality
The total Code quality score is 8 out of 10.
Template code patterns were found (TransferHelper).
The development environment is configured.
Test coverage
Code coverage of the project is 94.80% (branch coverage).
Deployment and basic user interactions are covered with tests.
Deployment instructions are not provided.
Security score
Upon auditing, the code was found to contain 0 critical, 3 high, 6 medium, and 3 low severity issues. Out of these, 12 issues have been addressed and resolved, 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.1. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
There are complex fee and reward formulas used in the project. However, since no documentation is provided, only the mathematical correctness of these formulas can be checked. It is not possible to check if the formulas actually return the intended values.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-1466 | Highly Permissive Role Access | fixed | High | |
| F-2023-1465 | Highly Permissive Role Access | fixed | High | |
| F-2023-1464 | Unverifiable Logic | fixed | High | |
| F-2023-147 | Requirements Violations | fixed | Medium | |
| F-2023-1471 | Contradiction - Function Name - Functionality Mismacth | fixed | Medium | |
| F-2023-147 | Tautology | fixed | Medium | |
| F-2023-146 | Contradiction - Missing validation | fixed | Medium | |
| F-2023-1468 | Denial of Service | fixed | Medium | |
| F-2023-1467 | Inconsistent data - Variable is not limited | fixed | Medium | |
| F-2023-147 | Missing Zero Check Before Transfer | fixed | Low |
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/OptimusVentures/HODLAudit→ |
| Commit | c6cd38fbea2aafbe346de04010f6dbc77aa301a0 |
| Whitepaper | Not provided |
| Requirements | Provided |
| Technical Requirements | Provided |
Scope Details
- Commit
- c6cd38fbea2aafbe346de04010f6dbc77aa301a0
- Whitepaper
- Not provided
- Requirements
- Provided
- Technical Requirements
- Provided