Introduction
We express our gratitude to the SophiaVerse team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Staking |
| Timeline | 15/03/2024 - 18/03/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/MiguelBits/multiplier-stake→ |
| Commit | 10d24c8603ae4feb9df5d828ba186b6675cf0722 |
Review Scope
- Commit
- 10d24c8603ae4feb9df5d828ba186b6675cf0722
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 SophiaVerse |
| Audited By | Carlo Parisi, Viktor Raboshchuk |
| Approved By | Przemyslaw Swiatowiec |
| Website | - |
| Changelog | 19/03/2024 - Preliminary Report |
| 29/03/2024 - First Remediation | |
| 05/04/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for SophiaVerse
- Audited By
- Carlo Parisi, Viktor Raboshchuk
- Approved By
- Przemyslaw Swiatowiec
- Website
- -
- Changelog
- 19/03/2024 - Preliminary Report
- 29/03/2024 - First Remediation
- 05/04/2024 - Final Report
System Overview
SophiaVerse is a staking protocol with the following contracts:
StakeBooster — This contract allows users to stake their tokens for a fixed period of time (90, 180, or 360 days). It inherits from the ERC1155 contract, which is a standard for contracts that manage multiple token types. It also uses the ReentrancyGuard and Pausable contracts from OpenZeppelin for additional security and functionality.
BoosterBronze - This contract is a specific implementation of the StakeBooster contract. It inherits all the functionality of the StakeBooster contract.
BoosterGold - This contract is a specific implementation of the StakeBooster contract. It inherits all the functionality of the StakeBooster contract,.
BoosterDiamond - This contract is a specific implementation of the StakeBooster contract. It inherits all the functionality of the StakeBooster contract.
Privileged roles
The owner can pause and unpause the staking functionality and upgrade stake functionality.
Executive Summary
Documentation quality
The total Documentation Quality score is 10 out of 10.
Functional requirements are mostly provided.
The technical description is provided.
NatSpec is provided.
Code quality
The total Code Quality score is 10 out of 10.
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, 0 high, 0 medium, and 0 low severity issues, 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 project utilizes Solidity version 0.8.20 or higher, which includes the introduction of the PUSH0 (0x5f) opcode. This opcode is currently supported on the Ethereum mainnet but may not be universally supported across other blockchain networks. Consequently, deploying the contract on chains other than the Ethereum mainnet, such as certain Layer 2 (L2) chains or alternative networks, might lead to compatibility issues or execution errors due to the lack of support for the PUSH0 opcode. In scenarios where deployment on various chains is anticipated, selecting an appropriate Ethereum Virtual Machine (EVM) version that is widely supported across these networks is crucial to avoid potential operational disruptions or deployment failures.
The pause and unpause functionality are currently using the onlyOwner modifier, but such modifier has not been declared nor inherited.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-1585 | Unchecked return value from token transfers | fixed | Observation | |
| F-2024-1584 | Missing zero address check in the constructor | fixed | Observation | |
| F-2024-1582 | Violation of checks-effects-interactions pattern in stake function | fixed | Observation | |
| F-2024-1581 | Floating pragma statement | fixed | Observation |
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/MiguelBits/multiplier-stake→ |
| Commit | 10d24c8603ae4feb9df5d828ba186b6675cf0722 |
| Whitepaper | |
| Requirements | https://github.com/MiguelBits/multiplier-stake→ |
| Technical Requirements | Web3-Staking Booster-Documentation.pdf |
Scope Details
- Commit
- 10d24c8603ae4feb9df5d828ba186b6675cf0722
- Whitepaper
- Requirements
- https://github.com/MiguelBits/multiplier-stake→
- Technical Requirements
- Web3-Staking Booster-Documentation.pdf