Introduction
We express our gratitude to the UGO team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
UGO protocol pioneers a revolutionary platform offering presale opportunities and vesting mechanisms, facilitating the equitable distribution of UGO tokens among users.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Vesting, Presale, BEP20 |
| Timeline | 14/05/2024 - 12/07/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://gitlab.com/gooo-group/ugo-token-vesting-contract→ |
| Commit | 1f71e28 |
Review Scope
- Commit
- 1f71e28
Audit Summary
10/10
98.3%
10/10
7/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 UGO |
| Audited By | Seher Saylik |
| Approved By | Ataberk Yavuzer |
| Website | https://ugotoken.io/→ |
| Changelog | 17/05/2024 - Preliminary Report |
| 28/05/2024 - Final Report | |
| 12/07/2024 - Additional Review (Commit id: c28eb29) |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for UGO
- Audited By
- Seher Saylik
- Approved By
- Ataberk Yavuzer
- Website
- https://ugotoken.io/→
- Changelog
- 17/05/2024 - Preliminary Report
- 28/05/2024 - Final Report
- 12/07/2024 - Additional Review (Commit id: c28eb29)
System Overview
UGO is a vesting protocol with the following contracts:
TokenPresale — a contract that facilitates the management of presale events for BEP20 tokens, enabling token distribution with vesting mechanisms and whitelist management to ensure fair participation among users. Whitelisted users can acquire tokens by submitting the designated fee within the system, with their purchases automatically subject to the current vesting configuration within the TokenVesting contract.
TokenVesting — a contract that manages token vesting schedules, allowing for the creation, revocation, and release of vested tokens according to specified schedules for beneficiaries. The vesting operations for purchases made in the TokenPresale contract are managed in this contract. Users can easily withdraw their vested rewards when they become due.
Token — a basic BEP20 token contract that mints an initial supply to the owner. Additional minting is allowed and the total token supply is not capped.
It has the following attributes:
Name: Defined during the deployment
Symbol: Defined during the deployment
Decimals: 18
Total supply: 10 Billion
Privileged roles
The owner of the Token contract can pause/unpause the contract, snapshot and, can mint new tokens.
The owner of the TokenPresale contract can set the operator address, set the token vesting address, set the sale token address, set the USDT address, set the vesting config, transfer the vesting contract's ownership, create a new presale config, change sale times, change the presale token price, pause/unpause the presale, withdraw tokens from the contract,
The owner of the TokenVesting contract can create a vesting schedule, withdraw tokens except for the ones separated for vesting,
Executive Summary
Documentation quality
The total Documentation quality score is 7 out of 10.
Functional requirements are partially missed.
Technical description is provided.
NatSpec is missing for some functions.
Code quality
The total Code quality score is 10 out of 10.
The development environment is configured.
All the best practice issues are resolved.
Test coverage
Code coverage of the project is 98.3% (branch coverage).
Deployment and basic user interactions are covered with tests.
Negative cases coverage is missed.
Interactions by several users are not tested thoroughly.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 4 medium, and 4 low severity issues. Out of these, 7 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.5. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
Regardless of whether the presale has already commenced, the platform owner retains the authority to make changes to the presale configuration, including start time, end time, and pricing, at any given time.
Dependency on Unaudited External Libraries: The project utilizes libraries or contracts without security audits, potentially introducing vulnerabilities. This compromises the security of the audited system, making it susceptible to attacks exploiting these external weaknesses.
Centralized Control of Minting Process: The token contract’s design allows for centralized control over the minting process, posing a risk of unauthorized token issuance, potentially diluting the token value and undermining trust in the project's economic governance. The owner of the ERC20 token is authorized to mint infinitive tokens.
Administrative Key Control Risks: The digital contract architecture relies on administrative keys for critical operations. Centralized control over these keys presents a significant security risk, as compromise or misuse can lead to unauthorized actions or loss of funds.
The responsibility for managing price decimals within the system rests with the protocol owner. It is the owner's responsibility to ensure accurate specification of decimal precision during presale configuration to prevent potential discrepancies and ensure proper pricing.
The protocol owner has clarified that the amount entered in the buyWithUSDT() function to acquire presale tokens must adhere to a format of 10e18 (18 decimals). For example, users intending to purchase 1 presale token should express the parameter "amount" as 1x10e18.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-2990 | Undocumented Behaviour | fixed | Medium | |
| F-2024-2989 | Centralization Risks | accepted | Medium | |
| F-2024-2949 | Requirement Violation | fixed | Medium | |
| F-2024-2905 | Price Can Be Zero When The Amount To Be Purchased Is Low | fixed | Medium | |
| F-2024-2912 | Contracts Are Designed to Receive BNB Do Not Implement Withdrawal | fixed | Low | |
| F-2024-2911 | Use Ownable2Step Rather Than Owned of solmate | fixed | Low | |
| F-2024-2910 | Missing Checks For address(0) in constructor/initializer | fixed | Low | |
| F-2024-2906 | USDT Price is Calculated Incorrectly in the View Function | fixed | Low | |
| F-2024-2919 | Duration is Not Checked In setVestingConfig() | fixed | Observation | |
| F-2024-2918 | Vesting Data Is Not Checked In constructor | 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://gitlab.com/gooo-group/ugo-token-vesting-contract→ |
| Commit | 1f71e286e0d9c7aa169df5e2902bcf94448890d6 |
| Whitepaper | https://ugotoken.io/white-paper.pdf→ |
| Requirements | N/A |
| Technical Requirements | https://gitlab.com/gooo-group/ugo-token-vesting-contractblob/main/README.md→ |
Scope Details
- Commit
- 1f71e286e0d9c7aa169df5e2902bcf94448890d6
- Whitepaper
- https://ugotoken.io/white-paper.pdf→
- Requirements
- N/A
- Technical Requirements
- https://gitlab.com/gooo-group/ugo-token-vesting-contractblob/main/README.md→