Introduction
We express our gratitude to the HyperCycle team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
HypercycleV2 is a crowd protocol that allows users to gather ERC20 HyPC tokens together to swap for ERC721 c_HyPC.
| title | content |
|---|---|
| Platform | Ethereum, Bitcoin, Cosmos, Polkadot, Avalanche, Algorand, Cardano, Others |
| Language | Solidity |
| Tags | Fungible Token, Non-fungible Token |
| Timeline | 15/08/2023 - 19/09/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/hypercycle-development/hypercycle-contracts→ |
| Commit | 915071d |
Review Scope
- Commit
- 915071d
Audit Summary
10/10
100%
10/10
10/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 HyperCycle |
| Audited By | Hacken |
| Website | https://www.hypercycle.ai/→ |
| Changelog | 22/08/2023 – Initial Review |
| 31/08/2023 - Second Review | |
| 19/09/2023 - Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for HyperCycle
- Audited By
- Hacken
- Website
- https://www.hypercycle.ai/→
- Changelog
- 22/08/2023 – Initial Review
- 31/08/2023 - Second Review
- 19/09/2023 - Third Review
System Overview
HypercycleV2 is a crowd protocol with the following contracts:
CrowdFundHYPCPoolV2 — allows users to gather ERC20 HyPC tokens together to swap for ERC721 c_HyPC.
c_HyPC can be used to back a license in the HyperCycle ecosystem.
Since a high volume of HyPC is required for a swap, a pooling contract is useful for users wanting to have HyPC back their licenses.
A license holder can create a proposal in the pool for 1 c_HyPC to back their license. They add HyPC as collateral for this lean, which will be used as interest payments for the users that provide HyPC for the proposal.
A license holder can create a proposal for multiple c_HyPC instead of just one.
Privileged roles
Contract Owner: change pool fees.
Proposal Owner: change proposal assignments, transfer ownership, cancel proposals.
Deposit Owner: transfer deposits, update deposits, withdraw deposits.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
Functional requirements are detailed.
Run instructions are provided.
NatSpec is sufficient.
Code quality
The total Code quality score is 10 out of 10.
An updated Solidity version is used.
The development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage).
Deployment and basic user interactions are covered with tests.
Security score
Upon auditing, the code was found to contain 0 critical, 1 high, 3 medium, and 7 low severity issues. Out of these, 11 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 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The audited contract interacts with other contracts that are out-of-scope, and thus its logic cannot be validated: CHYPC.sol, HyperCycleToken.sol, HyperCycleSwap.sol.
Fees do not have constraints and expected behavior on proposal creation relies on the data inputted by the frontend. In the case the fee is too high and the frontend blindly inputs the fee, the amount transferred can be unexpected by the final user. Before calling the createProposal() method, the user should double check the fee amount.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-1453 | Requirements Violation | fixed | High | |
| F-2023-1456 | NatSpec Contradiction | fixed | Medium | |
| F-2023-1455 | Inefficient Gas Model | fixed | Medium | |
| F-2023-1454 | Undocumented Functionality | fixed | Medium | |
| F-2023-146 | Best Practice Violation - Checks-Effects-Interactions Pattern | fixed | Low | |
| F-2023-146 | Redundant Code | fixed | Low | |
| F-2023-146 | Undocumented Parameter | fixed | Low | |
| F-2023-146 | Missing Zero Address Validation | fixed | Low | |
| F-2023-1459 | Redundant Code | fixed | Low | |
| F-2023-145 | Redundant View Functions | 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/hypercycle-development/hypercycle-contracts→ |
| Commit | 915071d |
| Whitepaper | Not provided |
| Requirements | Provided |
| Technical Requirements | Provided |
Scope Details
- Commit
- 915071d
- Whitepaper
- Not provided
- Requirements
- Provided
- Technical Requirements
- Provided