Introduction
We express our gratitude to the Avive team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
According to the functional requirements, the Avive Tokenomics contract will serve as the vault for the unlocked ERC20 Avive tokens.
| title | content |
|---|---|
| Platform | ArbitrumOne |
| Language | Solidity |
| Tags | ERC20 Vault |
| Timeline | 22/04/2024 - 26/04/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/AviveWorld/Token/→ |
| Commit | 02f4c6d4b82b0d342ee13f08e96458b274d7c0a4 |
Review Scope
- Repository
- https://github.com/AviveWorld/Token/→
- Commit
- 02f4c6d4b82b0d342ee13f08e96458b274d7c0a4
Audit Summary
10/10
100%
7/10
6/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 Avive |
| Audited By | , Giovanni Franchi |
| Approved By | Yves Toiser |
| Website | http://avive.world/→ |
| Changelog | 25/04/2024 - Preliminary Report |
| 26/04/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Avive
- Audited By
- , Giovanni Franchi
- Approved By
- Yves Toiser
- Website
- http://avive.world/→
- Changelog
- 25/04/2024 - Preliminary Report
- 26/04/2024 - Final Report
System Overview
AviveTokenomics — is a contract that distributes Avive tokens (ERC20) for a certain amount to the contract holder every month (the so-called round) until the last 60th round.
Privileged roles
The owner of the contract can call a special function to release tokens on a monthly basis.
The owner can also interact with the Ownable functionalities such as: renounce and transfer ownership.
Executive Summary
Documentation quality
The total Documentation Quality score is 6 out of 10.
Functional requirements are provided but do not consistently reflect the underlying implementation.
Technical description is not provided.
NatSpec comments are provided.
Code quality
The total Code Quality score is 7 out of 10.
The code follows Solidity style guide recommendations.
The code partially adheres to common best practises.
The development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage).
Test coverage is not mandatory below 250 lines of code.
Security score
Upon auditing, the code was found to contain 1 critical, 0 high, 1 medium, and 2 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. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The funds specified in the documentation are not automatically blocked at the time of deployment under the contract. In order for this process to occur, the holder must make a transfer equal to the amount expected to cover all 55 remaining allocation tranches of the protocol. This point introduces a significant degree of centralization and reliance on trust. A similar perspective can also be extended to the procedure for unlocking and distributing tokens. When a pre-determined time threshold is reached, funds are not allocated directly to the expected beneficiaries. The code flow implies that funds can only be withdrawn by the owner using the releaseByMonth() function. After performing this action, the owner is responsible for transferring the correct number of tokens to the correct beneficiary. Therefore, it is important to note that the in scope protocol does not guarantee that the entire distribution scheme will be applied as described in the documentation. AviveTokenomics.sol only serves to block a certain number of tokens for a certain time if the initial transfer was correctly executed by the owner.
The first 5 Release strucs are marked as released in the constructor. Although this operation serves the purpose of maintaining consistency with the tokenomics schedule described in the documentation, it is not possible to demonstrate and confirm that these aforementioned allocations were actually released, accurately reflecting the data recorded into the storage at the time of deployment.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-1471 | Invalid implicit conversion from uint256 to uint8 leads to the code not compiling | fixed | Critical | |
| F-2024-1472 | The description in the documentation does not match the implementation in the code | fixed | Medium | |
| F-2024-1487 | Irreversible ownership surrender vulnerability | fixed | Low | |
| F-2024-1486 | Lack of two step ownership transfer mechanism | accepted | Low | |
| F-2024-1489 | Lack of zero address check for underlying token in the constructor | fixed | Observation | |
| F-2024-1485 | Use of hardcoded number in release schedule initialisation | fixed | Observation | |
| F-2024-1470 | Large numeric literals should use underscores for readability | accepted | Observation | |
| F-2024-1468 | Using require in conjunction with string message when custom errors can be used instead | accepted | Observation | |
| F-2024-1467 | Unoptimized gas usage in function calls | fixed | Observation | |
| F-2024-1463 | Variables that are defined only in the constructor should be immutable | 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/AviveWorld/Token/→ |
| Commit | 02f4c6d4b82b0d342ee13f08e96458b274d7c0a4 |
| Whitepaper | N/A |
| Requirements | https://github.com/AviveWorld/Token/blob/main/README.md→ |
| Technical Requirements | N/A |
Scope Details
- Repository
- https://github.com/AviveWorld/Token/→
- Commit
- 02f4c6d4b82b0d342ee13f08e96458b274d7c0a4
- Whitepaper
- N/A
- Technical Requirements
- N/A
Remediation Scope Details | |
|---|---|
| Repository | https://github.com/AviveWorld/Token/→ |
| Last commit in scope | dcbec8091dfd92d8d860f16cba7b1c80c7bc92e0 |
| Whitepaper | N/A |
| Requirements | https://github.com/AviveWorld/Token/blob/main/README.md→ |
| Technical Requirements | N/A |
Remediation Scope Details
- Repository
- https://github.com/AviveWorld/Token/→
- Last commit in scope
- dcbec8091dfd92d8d860f16cba7b1c80c7bc92e0
- Whitepaper
- N/A
- Technical Requirements
- N/A