Introduction
We express our gratitude to the WoW Max team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
The project "WoW Max" is a decentralized exchange (DEX) aggregator designed with the objective of optimizing exchange amounts. Its primary function involves analyzing token prices across multiple DEX platforms and identifying the most efficient exchange path among various exchange protocols.
title | content |
---|---|
Platform | EVM |
Language | Solidity |
Tags | DEX |
Timeline | 01/08/2023 - 29/08/2023 |
Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
---|---|
Repository | https://github.com/wowswap-io/wowmax-contracts→ |
Commit | e34a1be3c45996ba52861a1fa4ec843071a20b37 |
Review Scope
- Commit
- e34a1be3c45996ba52861a1fa4ec843071a20b37
Audit Summary
10/10
100%
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 WoW Max |
Audited By | Hacken |
Website | https://wowmax.exchange/→ |
Changelog | 07/08/2023 - Initial Review |
29/08/2023 - Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for WoW Max
- Audited By
- Hacken
- Website
- https://wowmax.exchange/→
- Changelog
- 07/08/2023 - Initial Review
- 29/08/2023 - Second Review
System Overview
The project "WoW Max" is a decentralized exchange (DEX) aggregator designed with the objective of optimizing exchange amounts. Its primary function involves analyzing token prices across multiple DEX platforms and identifying the most efficient exchange path among various exchange protocols.
By doing so, WOWMAX aims to provide users with the best possible returns on their token exchanges, maximizing their gains while reducing potential losses.
The files in the scope:
WowmaxRouter.sol - The contract that the users interact with. Responsible for the swapping logic of WoW Max which interacts with several verified DEXes.
WowmaxSwapReentrancyGuard.sol - The reentrancy guard implementation for the WowmaxRouter.sol which does not allow for reentry during any swapping operations.
IWETH.sol - Interface for the native token wrapper.
IWowmaxRouter.sol - Interface for WowmaxRouter.sol
Curve.sol - Swapping library for Curve like swapping protocols.
DODOV1.sol - Swapping library for DODOV1 swapping protocol.
DODOV2.sol - Swapping library for DODOV2 swapping protocol.
Fulcrom.sol - Swapping library for Fulcron swapping protocol.
Hashflow.sol - Swapping library for Hashflow swapping protocol.
Level.sol - Swapping library for Level swapping protocol.
PancakeSwapStable.sol - Swapping library for PancakeSwap like protocols.
Saddle.sol - Swapping library for Saddle swapping protocol.
UniswapV2.sol - Swapping library for UniswapV2 swapping protocol.
UniswapV3.sol - Swapping library for UniswapV3 swapping protocol.
Wombat.sol - Swapping library for Wombat swapping protocol.
WooFi.sol - Swapping library for WooFi swapping protocol.
Privileged roles
Owner: Can withdraw excess funds from the contract, in case of leftovers after a swap, or invalid swap requests.
User: Can interact with the WowmaxRouter.swap to swap tokens.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
Functional requirements are provided.
Technical description is provided.
Description of the development environment is present.
Code quality
The total Code quality score is 10 out of 10.
The code follows the Solidity style guides.
The development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage).
Deployment and user interactions are covered with tests.
Security score
Upon auditing, the code was found to contain 3 critical, 2 high, 3 medium, and 2 low severity issues. Out of these, 6 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 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The implementations of the swapping logic used in the system are out of scope of this contract, and therefore their safety cannot be verified.
The amountOutExpected
parameter during swaps is user-provided. A check for it to be non-zero is implemented; however, the value cannot be fully monitored and the risk for it to be invalid is present.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2023-0747 | Missing Validation | mitigated | Critical | |
F-2023-0746 | Balance Manipulation | mitigated | Critical | |
F-2023-0745 | Access Control Violation | mitigated | Critical | |
F-2023-0749 | Possible Funds Loss | fixed | High | |
F-2023-0748 | Sandwich Attack | fixed | High | |
F-2023-0752 | Unsafe Usage of Third Party Protocol | mitigated | Medium | |
F-2023-0751 | Missing Validation | fixed | Medium | |
F-2023-0750 | Usage Of Built-in Transfer | fixed | Medium | |
F-2023-0754 | Redundant Import | fixed | Low | |
F-2023-0753 | Out-Of-Bounds Array Access | 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/wowswap-io/wowmax-contracts→ |
Commit | e34a1be3c45996ba52861a1fa4ec843071a20b37 |
Whitepaper | Provided→ |
Requirements | Provided→ |
Technical Requirements | Provided→ |
Contracts in Scope
contracts/WowmaxRouter.sol
contracts/WowmaxSwapReentrancyGuard.sol
contracts/interfaces/IWETH.sol
contracts/interfaces/IWowmaxRouter.sol
contracts/libraries/Curve.sol
contracts/libraries/DODOV1.sol
contracts/libraries/DODOV2.sol
contracts/libraries/Fulcrom.sol
contracts/libraries/Hashflow.sol
contracts/libraries/Level.sol
contracts/libraries/PancakeSwapStable.sol
contracts/libraries/Saddle.sol
contracts/libraries/UniswapV2.sol
contracts/libraries/UniswapV3.sol
contracts/libraries/Wombat.sol
contracts/libraries/WooFi.sol