Introduction
We express our gratitude to the Twin Protocol team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
TwinProtocolToken is a simple ERC-20 token which mints all the total supply to the deployer. The contract also implements burnable functionalities.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for Twin Protocol |
| Audited By | Farrukh Odinaev |
| Approved By | Yves Toiser |
| Website | https://twinprotocol.com/→ |
| Changelog | 21/08/2024 - Preliminary Report & 30/08/2024 - Final Report |
| Platform | Ethereum |
| Language | Solidity |
| Tags | ERC20 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Twin Protocol
- Audited By
- Farrukh Odinaev
- Approved By
- Yves Toiser
- Website
- https://twinprotocol.com/→
- Changelog
- 21/08/2024 - Preliminary Report & 30/08/2024 - Final Report
- Platform
- Ethereum
- Language
- Solidity
- Tags
- ERC20
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/VDoITGit/TWIN-token-contract→ |
| Commit | 51c3d62 |
Review Scope
- Commit
- 51c3d62
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are provided.
Technical description is not provided.
Code quality
The code adheres to Solidity Style Guide's recommendation. The code code adheres to best practices in terms of readability.
The development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage),
Tests are not mandatory below 250 lines of code.
System Overview
TwinProtocolToken — simple ERC-20 token that mints all initial supply to a deployer. Additional minting is not allowed. The contract additionally implements burnable functionalities.
It has the following attributes:
Name: Will be set at deployment.
Symbol: Will be set at deployment.
Decimals: 18
Total supply: 1 billion tokens.
Privileged roles
There are no privileged roles
Risks
The contract mints the entire token supply to the deployer upon deployment, creating a significant centralization risk. This concentration of tokens in a single address gives the deployer disproportionate control over the token's distribution and potentially the protocol's governance.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-5468 | Unnecessary type conversion in setting of MAX_SUPPLY state variable | 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/VDoITGit/TWIN-token-contract→ |
| Commit | 51c3d627997a22e5ecf5d3a4b5b13e9bc3c61dbc |
| Whitepaper | https://twinprotocol.gitbook.io/twin-protocol-ai-utility-token/white-paper→ |
| Requirements | https://twinprotocol.gitbook.io/twin-protocol-ai-utility-token→ |
| Technical Requirements | N/a |
Scope Details
- Commit
- 51c3d627997a22e5ecf5d3a4b5b13e9bc3c61dbc
- Technical Requirements
- N/a