Introduction
We express our gratitude to the Decubate team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Decubate is a mixed-purpose project which includes Staking Liquidity Farming and NFT Staking.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Liquidity Farming; LP Staking; NFT Staking |
| Timeline | 15/09/2022 - 06/12/2022 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/Decubate-com/ats-contracts→ |
| Commit | fddd1a87638d6d409c96c8051dd409c06fdc20ad |
Review Scope
- Commit
- fddd1a87638d6d409c96c8051dd409c06fdc20ad
Audit Summary
10/10
78.5%
9/10
3/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 Decubate |
| Audited By | Hacken |
| Website | https://www.decubate.com/→ |
| Changelog | 27/09/2022 - Initial Review |
| 20/10/2022 - Second Review | |
| 16/11/2022 - Third Review | |
| 06/12/2022 - Fourth Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Decubate
- Audited By
- Hacken
- Website
- https://www.decubate.com/→
- Changelog
- 27/09/2022 - Initial Review
- 20/10/2022 - Second Review
- 16/11/2022 - Third Review
- 06/12/2022 - Fourth Review
System Overview
Decubate - is a mixed-purpose project which includes Staking Liquidity Farming and NFT Staking. It has the following contracts.
The files in the scope:
DecubateMasterChef \- handles the single asset staking. It uses the DCBVault contract to automatically compound user rewards.
DCBVault \- a contract that is responsible for the auto compounding of rewards. Users deposit their token to the DCBVault contract, and the DCBVault contract then deposits to MasterChef.
DCBNFTStaking \- a contract for staking Decubate NFTs and getting rewards accordingly.
DCBLiquidityLocker \- a contract to add liquidity to DCB pools and lock the earned lp tokens.
Privileged roles
Owner of the DecubateMasterChef can:
update fee percent
update fee receiver
update compounder
add a new period to the pool
update pools’ end date, hard cap and max transferrable amount information
Owner of the DCBVaults can:
update fee percent
pause and unpause the contract
Owner of DCBNFTStaking can:
add a new period to the pool
update pools’ end date and hard cap information
update pools’ NFT information
Owner of DCBLiquidityLocker can:
add a new period to the pool
update pools’ end date information
Owner of DecubateStaking contract can:
update pools’ end date and hard cap information
update fee percent and time gap
add a new period the pool
set the max transfer input and max transfer reward
Executive Summary
Documentation quality
The total Documentation quality score is 3 out of 10.
Partial functional requirements are provided.
Technical description of DCBNFTStaking and DCBLiquidityLocker was not found in the provided documentation.
Function parameter explanations in NatSpec format were partially missed.
Weakly documented README file.
Code quality
The total Code quality score is 9 out of 10.
Code mostly follows the official style guide.
Testing setup requires a global truffle coverage install pegged to version v5.5.18
Test coverage
Code coverage of the project is 78.5% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is missed.
Interactions by several users are not tested thoroughly.
Security score
Upon auditing, the code was found to contain 1 critical, 11 high, 2 medium, and 8 low severity issues. Out of these, 20 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 8.3. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
DCBVault functions limited by the notContract modifier do not work with multisig wallets and similar constructs.
If the number of NFTs is big enough, some transactions, such as claim function, can fail due to exceeding Gas.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2022-1877 | Compilation Issues | fixed | Critical | |
| F-2022-1888 | Insufficient Balance | fixed | High | |
| F-2022-1887 | Highly Permissive Owner Access | fixed | High | |
| F-2022-1886 | Highly Permissive Owner Access | fixed | High | |
| F-2022-1885 | Highly Permissive Owner Access | fixed | High | |
| F-2022-1884 | Highly Permissive Owner Access | fixed | High | |
| F-2022-1883 | Insufficient Balance | fixed | High | |
| F-2022-1882 | Possible Hard Cap Overload | fixed | High | |
| F-2022-1881 | Highly Permissive Owner Access | fixed | High | |
| F-2022-1880 | Possible Denial of Service Vulnerability | mitigated | High |
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/Decubate-com/ats-contracts→ |
| Commit | fddd1a87638d6d409c96c8051dd409c06fdc20ad |
| Whitepaper | Not provided |
| Requirements | Provided→ |
| Technical Requirements | Not provided |
Scope Details
- Commit
- fddd1a87638d6d409c96c8051dd409c06fdc20ad
- Whitepaper
- Not provided
- Requirements
- Provided→
- Technical Requirements
- Not provided