Introduction
We express our gratitude to the Dexponent team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Dexponent emerges as an institutional-grade liquid staking platform designed to cater to institutions' distinct needs. It ensures clean staking practices, employs a non-custodial approach, separates funds, and introduces clETH, enabling instant liquidity for staked ETH. Dexponent also implements Account Abstraction for enhanced security and offers diverse utilities through clETH, presenting a comprehensive solution for institutions entering the liquid staking space.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Staking |
| Timeline | 21/03/2024 - 22/04/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://gitlab.ardourlabs.com/dexponent/smart-contracts/staking→ |
| Commit | 694381d07ab9f2dab336afc54a8bc7e7aa4e42c6 |
Review Scope
- Commit
- 694381d07ab9f2dab336afc54a8bc7e7aa4e42c6
Audit Summary
10/10
84.26%
8/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 Dexponent |
| Audited By | Max Fedorenko, Roman Tiutiun |
| Approved By | Grzegorz Trawinski |
| Website | https://dexponent.com/→ |
| Changelog | 27/03/2024 - Preliminary Report |
| 22/04/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Dexponent
- Audited By
- Max Fedorenko, Roman Tiutiun
- Approved By
- Grzegorz Trawinski
- Website
- https://dexponent.com/→
- Changelog
- 27/03/2024 - Preliminary Report
- 22/04/2024 - Final Report
System Overview
Dexponent is a staking protocol with the following contracts:
ClEth.sol - the contract operates as an ERC20 token but with expanded functionalities tailored for minting, burning, pausing functionalities, managing rewards, and assigning roles to other contracts or addresses.
TokenProxy.sol - the contract serves as a proxy for interacting with another contract while enabling transparent upgrades.
WClETH.sol - the contract is an ERC20 token with additional functionalities inherited from TokenStorage, OwnableUpgradeable, and PausableUpgradeable.
StakeHolder.sol - the contract serves as a secure holding space, acting as an intermediary or escrow for the Ethereum (ETH) staked by individual users.
StakingMaster.sol - the contract is the central contract of the staking system. It handles the logic for users staking ETH, managing their stakes, unstake, and interacting with the
CLETHtoken and individualStakeHoldercontracts.StakingMasterStorage.sol - the contract defines storage variables and mappings used by a staking master contract.
Event.sol - contract declares several events used to emit notifications about different actions.
TokenStorage.sol - abstract contract defines storage variables and emits an event.
LoanLogic.sol - the contract facilitates the management of loans and collateral within a lending system. It includes functions for creating loans, repaying loans, calculating loan parameters such as interest rates and maximum loan amounts, and liquidating collateral.
LoanStorage.sol - contract serves as a storage contract holding all state variables and structures related to loans and collateral within a lending system.
Privileged roles
The owner of the
LoanLogic.solcontract can update the CLETH price.The owner of the
StakeHolder.solcontract can be deposited to Figment.The owner of the
StakingMaster.solcontract can update the withdrawal status, claim a reward for Wcleth, and claim a reward for Cleth.
Executive Summary
Documentation quality
The total Documentation Quality score is 10 out of 10.
Code quality
The total Code Quality score is 8 out of 10.
Code contains redundant code.
Test coverage
Code coverage of the project is 84.26% (branch coverage).
Security score
Upon auditing, the code was found to contain 3 critical, 1 high, 5 medium, and 0 low severity issues. After the retest, most of the previously identified issues were resolved, leading to a security score 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. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
Admin might update the implementation of the Staking and Loan Logic anytime.
Admin approval is needed to unstake the funds.
Operations with CLETH token might be paused by admin.
Admin is responsible for accruing rewards individually to for all the stakers.
The Price Oracle which is used by the Loan Logic contract is set by the admin and is out of scope.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-2134 | Unfinalized code block | fixed | Critical | |
| F-2024-2131 | Fund Lock in LoanLogic Contract During liquidateCollateral Process | fixed | Critical | |
| F-2024-1746 | Liquidating Is Not Possible If The Borrower Do Not Approve Enough Tokens | fixed | Critical | |
| F-2024-1699 | Maximum Deposit Requirement Violation | fixed | High | |
| F-2024-2136 | Lack Of Validation For The Oracle Data | fixed | Medium | |
| F-2024-2120 | Mismatch Between Documentation and Implementation | fixed | Medium | |
| F-2024-1748 | Possible Discrepancy Between The Actual Contract Balance and Recorded Balance | fixed | Medium | |
| F-2024-1745 | Admin Might 'burn' Tokens From Any Address | fixed | Medium | |
| F-2024-1698 | Amount of Unstaked Tokens Is Not Deducted From The Staked Amount | fixed | Medium | |
| F-2024-2920 | Admin Can Initiate clETH Token Minting | accepted | 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:
Primary Scope Details | |
|---|---|
| Repository | https://gitlab.ardourlabs.com/dexponent/smart-contracts/staking→ |
| Commit | 694381d07ab9f2dab336afc54a8bc7e7aa4e42c6 |
| Whitepaper | https://docs.dexponent.com/→ |
| Requirements | https://docs.google.com/document/d/1d2KDcb8vZUns6Pm-xYeguJrxaUb6__kZGSdwTYbuXew/edit#heading=h.r6ltp1yoax1g→ |
| Technical Requirements | https://docs.google.com/document/d/1d2KDcb8vZUns6Pm-xYeguJrxaUb6__kZGSdwTYbuXew/edit#heading=h.r6ltp1yoax1g→ |
Primary Scope Details
- Commit
- 694381d07ab9f2dab336afc54a8bc7e7aa4e42c6
- Whitepaper
- https://docs.dexponent.com/→