Q1 2025 Web3 Security ReportAccess control failures led to $1.63 billion in losses
Discover report insights
  • Hacken
  • Audits
  • openeden
  • [SCA] OpenEden / Vault / Nov2024
OpenEden logo

OpenEden

Audit name:

[SCA] OpenEden / Vault / Nov2024

Date:

Dec 10, 2024

Table of Content

Introduction
Audit Summary
System Overview
Potential Risks
Findings
Appendix 1. Definitions
Appendix 2. Scope
Appendix 3. Additional Valuables
Disclaimer

Want a comprehensive audit report like this?

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

NameSmart Contract Code Review and Security Analysis Report for OpenEden
Audited ByStepan Chekhovskoi
Approved ByPrzemyslaw Swiatowiec
Websitehttps://openeden.com
Changelog29/11/2024 - Preliminary Report
10/12/2024 - Final Report
PlatformEthereum, Arbitrum, Base
LanguageSolidity
TagsDeFI, Vault
Methodologyhttps://hackenio.cc/sc_methodology
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for OpenEden
    Audited By
    Stepan Chekhovskoi
    Approved By
    Przemyslaw Swiatowiec
    Changelog
    29/11/2024 - Preliminary Report
    10/12/2024 - Final Report
    Platform
    Ethereum, Arbitrum, Base
    Language
    Solidity
    Tags
    DeFI, Vault

Review Scope

Repositoryhttps://github.com/OpenEdenHQ/openeden.vault.v2.audit
Initial Commit980995254706f34187440f9755c3507b6f647588
Final Commit1299050d098a626fffa2a652545ee40abb9f1d7a

Audit Summary

7Total Findings
3Resolved
1Accepted
3Mitigated

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-7411Potential Redeem Process DoS due to KYC User Ban
mitigated

Medium
F-2024-7422Possible Invalid Convert Rate due to Lack of Oracle Output Validation
fixed

Medium
F-2024-7417Unchecked Integers Casting
accepted

Low
F-2024-7429Lack Of Two-Step Ownership Transfer Mechanism
mitigated

Observation
F-2024-7415Is Now Weekend Check Automation
mitigated

Observation
F-2024-7439Lack of Fees Transfer to Treasury
fixed

Observation
F-2024-7416Revert Messages Optimization
fixed

Observation
1-7 of 7 findings

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

Repositoryhttps://github.com/OpenEdenHQ/openeden.vault.v2.audit
Initial Commit980995254706f34187440f9755c3507b6f647588
Final Commit1299050d098a626fffa2a652545ee40abb9f1d7a
WhitepaperN/A
Requirementshttps://docs.openeden.com
Technical RequirementsREADME.md

Assets in Scope

DoubleQueueModified.sol - DoubleQueueModified.sol
interfaces
IBuidlRedemption.sol - interfaces/IBuidlRedemption.sol
IController.sol - interfaces/IController.sol
IFeeManagerV3.sol - interfaces/IFeeManagerV3.sol
IKycManager.sol - interfaces/IKycManager.sol
IOpenEdenVaultV4.sol - interfaces/IOpenEdenVaultV4.sol
IPartnerShipV4.sol - interfaces/IPartnerShipV4.sol
IPriceFeed.sol - interfaces/IPriceFeed.sol
ITypes.sol - interfaces/ITypes.sol
OpenEdenVaultV4Impl.sol - OpenEdenVaultV4Impl.sol
PartnerShip.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 indexPassed500K+
  • 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.

Disclaimer