Introduction
We express our gratitude to the SingularityDAO team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
SDAO's MigrationToken project is designed to migrate from one token to another token smoothly.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Token Migration, ERC20 |
| Timeline | 17/04/2024 - 07/05/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/hknio/token-migration-b8db22ad2925958b636f2e0/tree/main→ |
| Commit | 6fc4fbe806038912179466621f70b895f82115d3 |
Review Scope
- Commit
- 6fc4fbe806038912179466621f70b895f82115d3
Audit Summary
10/10
100%
9/10
9/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 SingularityDAO |
| Audited By | Seher Saylik |
| Approved By | Ataberk Yavuzer |
| Website | http://singularitydao.ai/→ |
| Changelog | 19/04/2024 - Preliminary Report |
| 07/05/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for SingularityDAO
- Audited By
- Seher Saylik
- Approved By
- Ataberk Yavuzer
- Website
- http://singularitydao.ai/→
- Changelog
- 19/04/2024 - Preliminary Report
- 07/05/2024 - Final Report
System Overview
SDAO MigrationToken is a token conversion protocol facilitated by the following contracts:
MigrateToken — a contract that facilitates token migration, converting old tokens to new tokens based on a specified conversion ratio. It supports burning or transferring old tokens and minting or transferring new tokens accordingly, with configurable parameters such as burn address and mintability.
Clonable — a contract that provides functionality for creating and managing clones. It allows the creation of clones with a specified owner, enables ownership transfer, and ensures that only the owner can execute certain functions.
Privileged roles
The owner of the MigrateToken contract can initialize the contract within the parameters of the old token address, new token address, conversion ratio, mintability, burnability features and, the burn address.
The owner of Clonable contract can set the owner after cloning, transfer the ownership.
Executive Summary
Documentation quality
The total Documentation Quality score is 9 out of 10.
Functional requirements are partially missed.
Technical description is not provided.
NatSpec is provided.
Code quality
The total Code Quality score is 9 out of 10.
The code does not follow all the Solidity style guide recommendations; code layout was broken.
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, 0 high, 0 medium, and 4 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 9.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
No related risks were found in the reviewed audit.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-1369 | decimals() Is Not A Part Of The ERC-20 Standard | mitigated | Low | |
| F-2024-1368 | Return Values Of transfer()/transferFrom() Not Checked | fixed | Low | |
| F-2024-1367 | Contracts Are Vulnerable To Fee-on-transfer Accounting-related Issues | mitigated | Low | |
| F-2024-1366 | Incorrect Check In Burnable Feature Initialization | fixed | Low | |
| F-2024-1375 | Missing Event Emitting | fixed | Observation | |
| F-2024-1373 | public Functions Not Called By The Contract Should Be Declared External Instead | fixed | Observation | |
| F-2024-1371 | Constructor and initialize() Can Be Marked As Payable | fixed | Observation | |
| F-2024-1370 | State Variables That Are Used Multiple Times In a Function Should Be Cached In Stack Variables | 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/hknio/token-migration-b8db22ad2925958b636f2e0/tree/main→ |
| Commit | f185c31beaace0671972d1c2c5be6ea67a8a55e9 |
| Whitepaper | https://github.com/hknio/token-migration/blob/main/README.md→ |
| Requirements | \-→ |
| Technical Requirements | https://github.com/hknio/token-migration/blob/main/README.md→ |
Scope Details
- Commit
- f185c31beaace0671972d1c2c5be6ea67a8a55e9
- Requirements
- \-→
- Technical Requirements
- https://github.com/hknio/token-migration/blob/main/README.md→