Introduction
We express our gratitude to the Qooodo team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Qoodo is a quality management app that leverages the innovation of blockchain and AI, gamifying the world of compliance and productivity to create an engaging and efficient experience for businesses and teams.
| title | content |
|---|---|
| Platform | Polygon |
| Language | Solidity |
| Tags | ERC20, Staking |
| Timeline | 06/04/2023 - 24/05/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/NAPLOZZ/NAP-token-contracts→ |
| Commit | 6bee1f4 |
Review Scope
- Commit
- 6bee1f4
Audit Summary
10/10
93%
10/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 Qooodo |
| Audited By | Hacken |
| Website | https://qoodo.io→ |
| Changelog | 13/04/2023 – Initial Review |
| 24/05/2023 – Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Qooodo
- Audited By
- Hacken
- Website
- https://qoodo.io→
- Changelog
- 13/04/2023 – Initial Review
- 24/05/2023 – Second Review
System Overview
Qoodo.io is a mixed-purpose system with the following contracts:
NaplozzToken — ERC-20 token. It has the following attributes: \-Name: NAPLOZZ. \-Symbol: NAP. \-Decimals: 18. \-Total supply: no cap.
StakingNapTokens — a contract that rewards users for staking their NAP tokens. The reward can be set by the contract owner.
TokenDistributor — a contract that handles the distribution of ERC20 tokens. The contract distributes tokens over a set number of periods, and the reward per block adjusts automatically over the set periods.
TokenSplitter — a contract that splits tokens among a group of accounts based on predefined shares.
YearlyVesting — a vesting contract. Each contract handles the vesting process for a single user.
EcoSystemPool — documentation not provided, unclear functionalities.
Privileged roles
The owner of the TokenSplitter contract can arbitrarily update user shares.
The owner of StakingNAPTokens can pause and unpause the contract, withdraw the rewards balance, and update the staking reward rate.
The NaplozzToken contract role
MINTER_ROLEcan arbitrarily mint new tokens.The NaplozzToken contract role
BURNER_ROLEcan arbitrarily burn tokens from any user.The owner of the EcoSystemPool contract can update the token address.
Executive Summary
Documentation quality
The total Documentation quality score is 9 out of 10.
Functional requirements are partially missed.
Technical description is partially missed.
Code quality
The total Code quality score is 10 out of 10.
The development environment is configured.
The project follows Solidity style guides.
Test coverage
Code coverage of the project is 93% (branch coverage).
Security score
Upon auditing, the code was found to contain 2 critical, 4 high, 0 medium, and 12 low severity issues. Out of these, 18 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 9.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The contract NaplozzToken interacts with antisnipe contract in _beforeTokenTransfer() function, but its source cannot be verified for safety.
In Ecosystempool the function name init() is misleading as it is a normal setter and not an initialization function. It is better to properly give names to functions and variables in order to be intuitive and describe their functions.
The withdraw() functions of TokenDistributor and StakingNapToken have a typo in the error message, ‘or’ instead of ‘and’. It is better to describe the error as it is in order to provide the best user experience to the user that receives the error.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-1165 | Highly Permissive Role Access | fixed | Critical | |
| F-2023-1164 | Access Control Violation | fixed | Critical | |
| F-2023-1169 | Insufficient Balance | fixed | High | |
| F-2023-1168 | Insufficient Balance | fixed | High | |
| F-2023-116 | Highly Permissive Role Access | fixed | High | |
| F-2023-1166 | Race Condition | fixed | High | |
| F-2023-118 | Functions that Can Be Declared External | fixed | Low | |
| F-2023-118 | Style Guide Violation | fixed | Low | |
| F-2023-1179 | Bad Function Naming | fixed | Low | |
| F-2023-1178 | Inefficient Gas Model | 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/NAPLOZZ/NAP-token-contracts→ |
| Commit | 6bee1f4 |
| Whitepaper | Not provided |
| Requirements | Provided→ |
| Technical Requirements | Provided |
Scope Details
- Commit
- 6bee1f4
- Whitepaper
- Not provided
- Requirements
- Provided→
- Technical Requirements
- Provided