Introduction
We express our gratitude to the WhiteBIT team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
WhiteBIT is the largest European cryptocurrency exchange. WhiteBIT’s goal is to contribute to the mass adoption and popularization of blockchain technologies by implementing the most effective trading and staking tools on the most convenient terms.
title | content |
---|---|
Platform | EVM |
Language | Solidity |
Tags | Vesting |
Timeline | 19/07/2022 - 25/08/2022 |
Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
---|---|
Repository | https://github.com/whitebit-exchange/wbt-token/→ |
Commit | 7303a11b04a6ede4aa36bb9b25b25725c3315283 |
Review Scope
- Commit
- 7303a11b04a6ede4aa36bb9b25b25725c3315283
Audit Summary
10/10
9/10
10/10
10/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 WhiteBIT |
Audited By | Hacken |
Website | https://whitebit.com/ua→ |
Changelog | 22/07/2022 - Initial Review |
02/08/2022 - Second Review | |
25/08/2022 - Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for WhiteBIT
- Audited By
- Hacken
- Website
- https://whitebit.com/ua→
- Changelog
- 22/07/2022 - Initial Review
- 02/08/2022 - Second Review
- 25/08/2022 - Third Review
System Overview
WBT: Private Sale Vesting is a vesting project with the following contracts:
Escrow — is a vesting contract that allows the distribution of WBT tokens (the contract allows the distribution of any tokens). The time ranges for 5 schedules during which tokens are distributed are defined during the contract deployment. Before the schedules start, the owner adds the information about the vesting for each user (address and the amount of tokens). The amount is divided into 5 schedules (per 20% for each schedule) and is available to be transferred to the user by the contract owner at the appropriate time.
CustomOwnable — is a contract with the owner access mechanism, inherited by the Escrow contract.
testToken — is an ERC-20 token contract used for testing purposes.
IERC20 — is an interface for ERC-20 tokens, used in the Escrow contract, inherited by the testToken contract.
Privileged roles
The owner of the Escrow contract can add the information about the vesting for users before the distribution starting time, and remove the information for the vesting anytime. The owner triggers the vest (tokens distribution).
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
Functional requirements and a technical description were provided.
Code quality
The total Code quality score is 10 out of 10.
Most of the code follows official language style guides.
Unit tests were provided.
Architecture quality
The architecture quality score is 9 out of 10.
The architecture is clear.
The development environment was provided, but the instructions on how to deploy the code were not provided.
Security score
Upon auditing, the code was found to contain 0 critical, 2 high, 6 medium, and 8 low severity issues. Out of these, 15 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.9. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The tokens distribution, the correctness of amounts, and the receivers can not be guaranteed, as the contract owner adds and removes the information for the distribution tokens (users and amounts), and triggers the distribution.
There are contracts in the repository not included in the audit scope.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2022-1928 | Funds lock | fixed | High | |
F-2022-1927 | Denial of Service vulnerability | fixed | High | |
F-2022-1934 | Unoptimized loops usage | fixed | Medium | |
F-2022-1933 | Checks-Effects-Interaction pattern violation | fixed | Medium | |
F-2022-1932 | Missing events emit on changing important values | fixed | Medium | |
F-2022-1931 | Unoptimized loops usage | fixed | Medium | |
F-2022-1930 | Unoptimized loops usage | fixed | Medium | |
F-2022-1929 | Failing tests | fixed | Medium | |
F-2022-1942 | Missing zero address validation | fixed | Low | |
F-2022-1941 | Division before multiplication | fixed | Low |
Identify vulnerabilities in your smart contracts.
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/whitebit-exchange/wbt-token/→ |
Commit | 7303a11b04a6ede4aa36bb9b25b25725c3315283 |
Whitepaper | Not provided |
Requirements | Provided |
Technical Requirements | Provided |
Scope Details
- Commit
- 7303a11b04a6ede4aa36bb9b25b25725c3315283
- Whitepaper
- Not provided
- Requirements
- Provided
- Technical Requirements
- Provided