Introduction
We express our gratitude to the OpenEden team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
OpenEden offers 24/7, on-chain access to tokenized US Treasury securities for Web3 CFOs, DAO treasury managers, and buy-side institutional investors.
Document | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for OpenEden |
Audited By | Stepan Chekhovskoi |
Approved By | Przemyslaw Swiatowiec |
Website | https://openeden.com→ |
Changelog | 29/11/2024 - Preliminary Report |
10/12/2024 - Final Report | |
Platform | Ethereum, Arbitrum, Base |
Language | Solidity |
Tags | DeFI, Vault |
Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for OpenEden
- Audited By
- Stepan Chekhovskoi
- Approved By
- Przemyslaw Swiatowiec
- Website
- https://openeden.com→
- Changelog
- 29/11/2024 - Preliminary Report
- 10/12/2024 - Final Report
- Platform
- Ethereum, Arbitrum, Base
- Language
- Solidity
- Tags
- DeFI, Vault
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
---|---|
Repository | https://github.com/OpenEdenHQ/openeden.vault.v2.audit→ |
Initial Commit | 980995254706f34187440f9755c3507b6f647588 |
Final Commit | 1299050d098a626fffa2a652545ee40abb9f1d7a |
Review Scope
- Initial Commit
- 980995254706f34187440f9755c3507b6f647588
- Final Commit
- 1299050d098a626fffa2a652545ee40abb9f1d7a
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are provided.
Technical description is comprehensive.
Code quality
The code structure is clear.
Test coverage
Code coverage of the project is 70% (branch coverage).
Tests cover most of the functionality partially missing negative cases.
System Overview
The TBILL protocol is a decentralized framework designed to enable secure and efficient subscription and redemption of tokenized Treasury Bills (TBILLs). At its core, the architecture integrates smart contracts to manage user interactions and enforce critical operations such as KYC verification, fee management, and price updates.
The audit covers the OpenEdenVault
contract upgrade to the version 4. The following features are implemented:
Allow cancelling out the txnFee for USDO mints for certain users.
Cancelled redemption requests are returned to sender instead of quarantined wallet.
Allow the ability to manually bypass firstDeposit rule for applicable wallet.
Allow setting of multiple operators.
Supporting instant redeem by using BUIDL.
Privileged roles
The
PartnerShip
contract Owner is able to set arbitrary partnership relations.The
OpenEdenVaultV4Impl
contract Owner is able to set the contract Maintainer and configure treasury, fee manager, KYC manager contract addresses.The
OpenEdenVaultV4Impl
contract Maintainer is able to set the contract Operators, configure partnership, buidl contract addresses, cancel user redemption requests.The
OpenEdenVaultV4Impl
contract Operators are able to withdraw any token from the contract to treasury and update epochs.
Potential Risks
Single Points of Failure and Control: The project is mostly centralized, introducing single points of failure and control. This centralization can lead to vulnerabilities in decision-making and operational processes, making the system more susceptible to targeted attacks or manipulation.
System Reliance on External Contracts: The functioning of the system relies on fee manager, buidl redemption, KYC manager external contracts. Any flaws or vulnerabilities in these contracts adversely affect the audited project, potentially leading to security breaches or loss of funds.
Potentially Insufficient Funds: The contract does not guarantee that there would be available enough underlying funds for redemption. User funds are transferred to Treasury contracts out of the audit scope.
External Calls in Iteration Risks: Making external calls within loops increases the risk of gas exhaustion, potentially leading to failed transactions and reduced contract reliability, especially when processing large datasets.
Reentrancy Assumptions: The project relies on the underlying (USDC) token does not delegate execution control to third parties. In case the token is changed or upgraded, Operators may break the contract state consistency reentering the processWithdrawalQueue
function.
Deprecated Safe Approve: The project utilizes deprecated safeApprove
method of SafeERC20
library for buidl token approval. The contract ensures the redemption process consumes the full allowance reducing the approve DoS risk due to non-zero allowance.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2024-7411 | Potential Redeem Process DoS due to KYC User Ban | mitigated | Medium | |
F-2024-7422 | Possible Invalid Convert Rate due to Lack of Oracle Output Validation | fixed | Medium | |
F-2024-7417 | Unchecked Integers Casting | accepted | Low | |
F-2024-7429 | Lack Of Two-Step Ownership Transfer Mechanism | mitigated | Observation | |
F-2024-7415 | Is Now Weekend Check Automation | mitigated | Observation | |
F-2024-7439 | Lack of Fees Transfer to Treasury | fixed | Observation | |
F-2024-7416 | Revert Messages Optimization | fixed | Observation |
Identify vulnerabilities in your smart contracts.
Appendix 1. Definitions
Severities
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. |
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.
Potential Risks
The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.
Appendix 2. Scope
The scope of the project includes the following smart contracts from the provided repository:
Scope Details | |
---|---|
Repository | https://github.com/OpenEdenHQ/openeden.vault.v2.audit→ |
Initial Commit | 980995254706f34187440f9755c3507b6f647588 |
Final Commit | 1299050d098a626fffa2a652545ee40abb9f1d7a |
Whitepaper | N/A |
Requirements | https://docs.openeden.com→ |
Technical Requirements | README.md |
Scope Details
- Initial Commit
- 980995254706f34187440f9755c3507b6f647588
- Final Commit
- 1299050d098a626fffa2a652545ee40abb9f1d7a
- Whitepaper
- N/A
- Requirements
- https://docs.openeden.com→
- Technical Requirements
- README.md
Assets in Scope
DoubleQueueModified.sol
interfaces/IBuidlRedemption.sol
interfaces/IController.sol
interfaces/IFeeManagerV3.sol
interfaces/IKycManager.sol
interfaces/IOpenEdenVaultV4.sol
interfaces/IPartnerShipV4.sol
interfaces/IPriceFeed.sol
interfaces/ITypes.sol
OpenEdenVaultV4Impl.sol
PartnerShip.sol
Appendix 3. Additional Valuables
Verification of System Invariants
During the audit of OpenEden, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Echidna →, a tool used for fuzz-testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.
Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Echidna fuzzing suite was prepared for this task, and throughout the assessment, 1 invariant was tested over 500K runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.
Invariant | Test Result | Run Count |
---|---|---|
DoubleQueueModified library keeps queue start index below the end index | Passed | 500K+ |
Invariant
- DoubleQueueModified library keeps queue start index below the end index
Test Result
- Passed
Run Count
- 500K+
Additional Recommendations
The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.
To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:
Detecting changes to ownership or critical permissions.
Monitoring large or unexpected transactions and minting events.
Pausing operations when irregularities are identified.
These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.