Introduction
We express our gratitude to the Asymetrix Protocol team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Asymetrix protocol is a decentralized, non-custodial protocol for asymmetric yield distribution generated from staking.
| title | content |
|---|---|
| Platform | Ethereum |
| Language | Solidity |
| Tags | ERC20 token, Staking, Yielding, Uniswap, Balancer, Oracle |
| Timeline | 04/10/2023 - 26/10/2023 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://bitbucket.ideasoft.io/projects/PBON/repos/solidity/commits/876a5a463c42c43613b49bcff313a0bcec68fe5e→ |
| Commit | 6a79c024e1c2a2b21fa8fc07b2960e1aadfa97cc |
Review Scope
- Commit
- 6a79c024e1c2a2b21fa8fc07b2960e1aadfa97cc
Audit Summary
9/10
97%
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 Asymetrix Protocol |
| Audited By | Hacken |
| Website | https://asymetrix.io/→ |
| Changelog | 11/10/2023 – Initial Review |
| 21/10/2023 – Second Review | |
| 26/10/2023 – Third Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Asymetrix Protocol
- Audited By
- Hacken
- Website
- https://asymetrix.io/→
- Changelog
- 11/10/2023 – Initial Review
- 21/10/2023 – Second Review
- 26/10/2023 – Third Review
System Overview
Asymetrix protocol is the decentralized, non-custodial protocol for asymmetric yield distribution generated from staking. The files in the scope:
StakePrizePoolv2 - Pool where users deposit stEth ERC20 token. Owner adds prizes manually. Also, rewards are distributed among all the contributors.
OracleUniswapV3 - Contract that given a TWAP period obtains the price of a token for a given pool. The protocol uses it to obtain the ASX price in terms of ETH.
OracleBalancerWeighted - Contract that obtains the price of ASX in terms of ETH using the liquidity on a given balancer pool.
ASXPriceFeed \- Contract that returns the price of ASX by computing an average price between the uniswap and balancer oracles.
ValuerUniswapV3 - Contract that returns the price in USD of a uniswapv3 pool position.
ValuerBalancer - Contract that returns the price in USD of a balancer pool position.
UniswapWrapper - Contract that performs a swap on a uniswapv3 pool.
RewardsBooster - Contract that enables users to stake their LP positions of ASX token and boost their rewards on the stake prize pool.
ValidatorUniswapV3 - Contract that validates if a position is legit on a given pool of uniswap v3.
ValidatorBalancerWeighted - Contract that validates if a position is legit on a balancer pool.
ESASX - Escrowed ASX. Is a non-tradable ERC20 token, used to reward protocol contributors.
ESASVesting - Contract that handles the ESASX vesting tokens from users.
Privileged roles
The owner of each contract can set and change multiple configuration values and also access restricted functionalities.
The manager/operator can access certain restricted functionalities.
Executive Summary
Documentation quality
The total Documentation quality score is 10 out of 10.
High level overview documentation has been created.
Technical descriptions have been provided and NatSpec is extensive.
Code quality
The total Code quality score is 10 out of 10.
The code is structured and readable.
The Gas model is optimized.
Test coverage
Code coverage of the project is 97% (branch coverage).
Deployment and some basic user interactions are covered with tests.
The extended code coverage was done after the audit.
Security score
Upon auditing, the code was found to contain 0 critical, 2 high, 4 medium, and 1 low severity issues. Out of these, 6 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.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
The protocol uses illiquid pools to compute token prices. Although the exploitation may not be direct it can represent an issue for the protocol if it is not treated properly. Furthermore, using the balance of a liquidity pool as an oracle is heavily discouraged.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2023-148 | Claim Rewards May Revert for Non-boosted Positions | fixed | High | |
| F-2023-1486 | Counter Not Updated to User | fixed | High | |
| F-2023-149 | Slippage Control Can Revert Due to Inaccurate Calculation | fixed | Medium | |
| F-2023-149 | unstake and extendLock May Revert Due to Access Control Modifier | fixed | Medium | |
| F-2023-148 | Usage of Deprecated ChainLink Oracle Function | fixed | Medium | |
| F-2023-148 | Price Oracle Manipulation | accepted | Medium | |
| F-2023-149 | createVesting Position on Claim Transaction Can Revert | fixed | Low | |
| I-2023-038 | Redeem Function Does Nothing | fixed | Observation | |
| I-2023-038 | Owner Can Renounce Itself | mitigated | Observation | |
| I-2023-038 | Centralization Risk | mitigated | 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://bitbucket.ideasoft.io/projects/PBON/repos/solidity/commits/876a5a463c42c43613b49bcff313a0bcec68fe5e→ |
| Commit | 6a79c024e1c2a2b21fa8fc07b2960e1aadfa97cc |
| Whitepaper | N/A |
| Requirements | N/A |
| Technical Requirements | N/A |
Scope Details
- Commit
- 6a79c024e1c2a2b21fa8fc07b2960e1aadfa97cc
- Whitepaper
- N/A
- Requirements
- N/A
- Technical Requirements
- N/A