Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] OpenEden | ERC20 | Oct2023

Date:

Oct 18, 2023

Table of Content

Introduction
Audit Summary
Document Information
System Overview
Executive Summary
Risks
Findings
Appendix 1. Severity Definitions
Appendix 2. Scope
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 Labs’s misson is to bring real-world assets to DeFi to unlock trillions of dollars in value.

titlecontent
PlatformEthereum
LanguageSolidity
TagsERC20
Timeline02/10/2023 - 17/10/2023
Methodologyhttps://hackenio.cc/sc_methodology

    Review Scope

    Repositoryhttps://github.com/OpenEdenHQ/openeden.vault.v2.audit
    Commit4aed24dac07c442ad0fca131b4749d950465d5be

    Audit Summary

    Total9.1/10
    Security Score

    9/10

    Test Coverage

    93.88%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    23Total Findings
    16Resolved
    7Accepted
    0Mitigated

    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

    NameSmart Contract Code Review and Security Analysis Report for OpenEden
    Audited ByHacken
    Websitehttps://openeden.com/
    Changelog09/10/2023 – Initial Review
    17/10/2023 – Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for OpenEden
      Audited By
      Hacken
      Changelog
      09/10/2023 – Initial Review
      17/10/2023 – Second Review

    System Overview

    Openeden, is an project that manages the TBILL stable ERC20 tokens. Users can deposit USDC to mint TBILL tokens, entitling them to redeem assets in proportion to their TBILL holdings. TBILL tokens are stored in whitelisted wallets, and the project's code governs deposit, withdrawal, and management functions, ensuring proper asset handling. It is built with the following contracts:

    • OpenEden T-Bills — Simple ERC-20 token used for shares. It has the following attributes: \-Name: OpenEden T-Bills. \-Symbol: TBILL. \-Decimals: 6. \-Total supply: No Max Supply Limit.

    • Controller — The Controller contract provides mechanisms for pausing and unpausing specific operations (deposit and withdraw) in a system.

    • FeeManager - The FeeManager contract provides mechanisms to manage various fee-related parameters in a system. This includes settings for transaction fees, deposit and withdrawal limits, management fee rates, and special considerations for weekends.

    • OpenEdenVaultV2 - OpenEdenVaultV2 is an upgradeable vault contract designed for managing deposits and withdrawals, charging fees, integrating with KYC systems, and operating under specific time-based rules.

    • TBillPriceOracle - Oracle contract provides a way to manage and update TBill prices with constraints on how much the price can deviate from previous values.

    • Timelock - Imports TimelockController from Openzeppelin.

    • OEPausable - The contract is designed to introduce "pausing" functionality into a contract by inheritance. This pausing mechanism can be utilized for emergency scenarios or other use cases to temporarily halt certain operations of a contract

    Privileged roles

    The DEFAULT_ADMIN_ROLE of the Controller contract can:

    • Pause and unpause deposits and withdrawals.

    The OPERATOR_ROLE of the Controller contract can:

    • Pause and unpause deposits and withdrawals.

    The Owner of the FeeManager contract can:

    • The owner can set various fee-related parameters like transaction fees, deposit and withdrawal limits, etc.

    • The owner inherits the capabilities provided by the OpenZeppelin's Ownable contract, such as the ability to transfer ownership or renounce ownership.

    The Owner of the OpenEdenVaultV2 can:

    • Set the treasury for the vault.

    • Set the treasury specific to 'q' (qTreasury).

    • Toggle whether the USDC/USD price is fixed.

    • Set various addresses, such as FeeManager, KycManager, Operator, USDC Price Feed, TBill Price Feed, and Controller.

    • Authorize contract upgrades.

    • Upgrade the contract.

    The Operator of the OpenEdenVaultV2 can:

    • Initiate off-ramp operations to transfer underlying assets to designated treasuries.

    • Process the withdrawal queue.

    • Update the epoch and set whether it is a weekend.

    • Claim the service fee.

    The DEFAULT_ADMIN_ROLE of the TBillPriceOracle can:

    • Grant and revoke the OPERATOR_ROLE.

    • Can update the maximum price deviation.

    • Can manually update the close NAV price.

    The OPERATOR_ROLE of the TBillPriceOracle can:

    • Can update the price.

    • Can update the close NAV price.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are provided.

    • Technical description is provided.

    • NatSpec is provided.

    Code quality

    The total Code quality score is 10 out of 10.

    Test coverage

    Code coverage of the project is 93.88% (branch coverage).

    • Deployment and basic user interactions are covered with tests.

    • The scenarios involving multiple user are tested thoroughly.

    • Negative case coverage is partially missing for the OEPausable.sol, DoubleQueueModified.sol, and OpenEdenVaultV2.sol contracts.

    Security score

    Upon auditing, the code was found to contain 2 critical, 0 high, 1 medium, and 6 low severity issues. Out of these, 7 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.1. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    At any given time, the owner or operator holds the capability to pause both withdrawals and deposits.

    The transaction fees within the system can be configured to any value, including 100%, which implies that users may receive nothing in return when attempting to deposit or redeem tokens. The fee is calculated and collected when the operator executes the withdrawal queue, based on the latest fee rate, not the rate at the time of user redemption.

    The TBILL price used in calculations is provided by an oracle through an off-chain mechanism and the implementation to sustain stable coin mechanism is also handled off-chain.

    The owner has the authority to withdraw any token including USDC from the contract.

    Only the operator has the authority to execute redemption requests, and the timing of execution is determined by the operator's discretion.

    The Treasury, oplTreasury and KycManager contracts are beyond the scope of this audit. The reliability of these contracts cannot be confirmed.

    The system employs a KYC process. There is a potential risk where a user, after receiving KYC approval and depositing tokens, could be subsequently banned. This would result in their tokens being permanently locked in their account.

    The redemption process relies on a centralized operator's discretion, and any issues or risks related to this operator's actions, such as insufficient USDC balance or centralization concerns, can result in users being unable to access their deposited TBILL tokens or the promised USDC tokens, potentially compromising the trustworthiness of the redemption process.

    There exists a risk where the backend system could fail to accurately set the isWeekend flag, which is crucial for enforcing the intended fee structure and deposit limits. In this case, users might be able to deposit funds under incorrect fee structures.

    The Open Eden operators can ban users, which may result in declining withdrawal requests if a user has already deposited funds. This mechanism was introduced to protect against withdrawal queue block due to USDC blacklisting mechanism.

    Findings

    Code
    Title
    Status
    Severity
    F-2023-137Missing KYC Verification in ‘Deposit()’ Function
    fixed

    Critical
    F-2023-1374Denial of Service; Assets Locked in Withdrawal Queue Due to Absent Verifications
    fixed

    Critical
    F-2023-1376 Unrestricted Fee Configuration
    accepted

    Medium
    F-2023-1382Missing Failover Mechanism to Unlock Withdrawal Queue Blocked by Non-Banned Users
    accepted

    Low
    F-2023-138Missing Protection Against USDC Depeg
    fixed

    Low
    F-2023-138Overpermisive offRamp Function
    fixed

    Low
    F-2023-1379Usage of Deprecated Oracle Functions
    fixed

    Low
    F-2023-1378Possibility of Dangerous Assumption on USDC Peg When Calculating TBillUsdcRate
    fixed

    Low
    F-2023-137Missing Zero Address Validation
    fixed

    Low
    I-2023-0345Missing Validation for Setting Deposit and Withdrawal Limits
    fixed

    Observation
    1-10 of 23 findings

    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

    Repositoryhttps://github.com/OpenEdenHQ/openeden.vault.v2.audit
    Commit4aed24dac07c442ad0fca131b4749d950465d5be
    WhitepaperNot provided
    RequirementsProvided
    Technical RequirementsProvided

    Contracts in Scope

    contracts
    Controller.sol - contracts › Controller.sol
    DoubleQueueModified.sol - contracts › DoubleQueueModified.sol
    feeManager.sol - contracts › feeManager.sol
    KycManager.sol - contracts › KycManager.sol
    OpenEdenVaultV2.sol - contracts › OpenEdenVaultV2.sol
    interfaces
    IFeeManager.sol - contracts › interfaces › IFeeManager.sol
    IKycManager.sol - contracts › interfaces › IKycManager.sol
    IOpenEdenVault.sol - contracts › interfaces › IOpenEdenVault.sol
    IPriceFeed.sol - contracts › interfaces › IPriceFeed.sol
    oracle
    TBillPriceOracle.sol - contracts › oracle › TBillPriceOracle.sol
    security
    OEPausable.sol - contracts › security › OEPausable.sol
    Timelock.sol - contracts › security › Timelock.sol

    Disclaimer