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 | Escrow |
| Timeline | 21/06/2022 - 31/08/202 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/whitebit-exchange/wbt-token→ |
| Commit | bec0cc57dfb5fba31decda33e524eb0b0ecef12d |
Review Scope
- Commit
- bec0cc57dfb5fba31decda33e524eb0b0ecef12d
Audit Summary
9/10
10/10
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 WhiteBIT |
| Audited By | Hacken |
| Website | https://whitebit.com/→ |
| Changelog | 24/06/2022 - Initial Review |
| 13/07/2022 - Second Review | |
| 31/08/2022 - Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for WhiteBIT
- Audited By
- Hacken
- Website
- https://whitebit.com/→
- Changelog
- 24/06/2022 - Initial Review
- 13/07/2022 - Second Review
- 31/08/2022 - Third Review
System Overview
WhiteBIT is Europe’s largest international centralized crypto-to-fiat exchange with over 2 million registered users and a team of 350+ members that meet all KYC and AML requirements.
WhiteBIT Token — simple ERC-20 token. It has the following attributes:
Name: WhiteBIT WBT.
Symbol: WBT.
Decimals: 8.
Total supply: 400m (100m for TRC network).
Escrow — smart contract that holds 200m (WBT) ERC20 tokens for distribution for 3 years according to the distribution schedule. Escrow contract includes an 8 weeks setup period allowing to set final token distribution schedule.
Privileged roles
The owner of the Escrow contract can transfer ownership to another address. The owner can leave the contract without an owner and remove functionality that is only available to the owner.
The owner of the Escrow contract can add a new vesting entry at a given time and quantity to an account’s schedule. The owner of the Escrow contract can destroy the vesting information associated with an account. All these changes the owner can do only during the setup period. ‘Setup’ period is 8 weeks long. The length of the period is set when the contract is deployed and cannot be changed later.
Executive Summary
Documentation quality
The total Documentation quality score is 7 out of 10.
The Customer provided superficial functional and technical requirements.
Code quality
The total Code quality score is 10 out of 10.
There are a lot of negative and positive cases.
Architecture quality
The architecture quality score is 10 out of 10.
Code is well-structured and easy-readable.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 2 medium, and 5 low severity issues. Out of these, 2 issues have been addressed and resolved, leading to a Security score of 9 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
In case of an admin keys leak, an attacker can transfer ownership to another address or remove the owner of the contract at all. If the ‘setup’ period does not end yet, then the attacker can destroy the vesting information associated with any account. During the ‘setup’ period, attackers can add their accounts to the vesting schedule. If the ‘setup’ period does end, the attacker cannot do anything to steal funds or do something harmful for Escrow smart contract.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2022-1921 | Costly operations inside a loop | unfixed | Medium | |
| F-2022-1920 | Unchecked call return value. | fixed | Medium | |
| F-2022-1926 | Functions that can be declared external. | unfixed | Low | |
| F-2022-1925 | Missing zero address validation | unfixed | Low | |
| F-2022-1924 | Functions that can be declared external. | unfixed | Low | |
| F-2022-1923 | Test coverage | fixed | Low | |
| F-2022-1922 | Gas limits and loops | unfixed | 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/whitebit-exchange/wbt-token→ |
| Commit | bec0cc57dfb5fba31decda33e524eb0b0ecef12d |
| Whitepaper | Provided→ |
| Requirements | Provided→ |
| Technical Requirements | Provided→ |