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

Audit name:

[SCA] ENKI | Vesting | Feb2024

Date:

Mar 13, 2024

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 ENKI team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

ENKI is a blockchain ecosystem that can distribute rewards to its users on both chains. It combines ERC4626 standar with the Vesting opportunities. Users holding Staked ENKI Metis receive their rewards in eMetis, maintaining consistency and simplicity in the reward cycle. The vesting mechanism, tied to the ENKI token, encourages sustained engagement and investment in the ecosystem, aligning user incentives with the long-term success of ENKI.

titlecontent
PlatformEthereum (L1), Metis Andromeda (L2)
LanguageSolidity
TagsMulti-chain, Vesting, Incentive
Timeline20/02/2024 - 12/03/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/ENKIXYZ/lsd-contracts/tree/v2/contracts→
    Commit934933f
    Remediation Commitaddd1fd

    Audit Summary

    Total9.4/10
    Security Score

    10/10

    Test Coverage

    100.0%

    Code Quality Score

    9/10

    Documentation Quality Score

    6/10

    16Total Findings
    10Resolved
    5Accepted
    1Mitigated

    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 ENKI
    Audited ByAtaberk Yavuzer, Vladyslav Khomenko
    Approved ByGrzegorz Trawinski
    Websitehttps://www.enkixyz.com/→
    Changelog28/02/2024 - Preliminary Report
    11/03/2024 - Final Report
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for ENKI
      Audited By
      Ataberk Yavuzer, Vladyslav Khomenko
      Approved By
      Grzegorz Trawinski
      Changelog
      28/02/2024 - Preliminary Report
      11/03/2024 - Final Report

    System Overview

    ENKI Protocol is a blockchain ecosystem with the following contracts:

    ENKI Metis (eMetis) — an ERC-20 token, pegged 1:1 to Metis tokens circulating in ENKI system. It supports gasless transfers. ENKI Metis Minter — contract that allows the exchange of Metis for eMetis. Exchanging the other way is currently disabled due to outside factors (restrictions in the Metis Sequencer). Staked ENKI Metis (seMetis) — a token of an ERC4626 vault. Staking eMetis in it lets users earn rewards in form of eMetis for participating in ENKI system. Unstaking eMetis is done in 2 steps: part of the tokens are released immediately, other part is temporarily locked in vesting contract. Vesting — this contract holds eMetis and postpones its withdrawal to ensure participants of the ENKI system are committed to it. To withdraw eMetis users have to deposit ENKI coins and wait for vesting period to pass. eMetis is then unlocked gradually. ENKI — utility token of the ENKI protocol, used to provide access to the eMetis in the Vesting contract. Rewards Dispatcher — this contract distributes rewards for participating in ENKI system in form of eMetis. The protocol takes it's cut of the yield and sends the rest to seMetis vault for users to claim. Config — common contract that stores configuration for the whole system. Dealer and SequencerAgent — contracts that manage the layer 1 part of the system.

    Privileged roles

    Owner & Timelock:

    • Grant timelock and eMetis minter roles.

    Timelock & Operator:

    • Grant and revoke various roles and capabilities.

    • Pause and unpause the protocol.

    • Make protocol public and vice versa.

    • Set protocol fee.

    • Set a cut of eMetis that goes to Vesting contract when eMetis is unstaked.

    Minter:

    • Mint and burn eMetis tokens.

    User:

    • Exchange Metis for eMetis.

    • Stake eMetis to generate rewards.

    • Unstake it and get part of the stake and rewards. Other part is kept in Vesting contract.

    • Stake ENKI to unlock the eMetis in Vesting contract.

    • Unstake ENKI and claim eMetis.

    Beta User:

    • Can participate while the system is not public.

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 6 out of 10.

    • Whitepaper is not provided.

    • Litepaper is provided.

    • Functional requirements are partially missed.

    • Technical description is not provided.

    Code quality

    The total Code Quality score is 9 out of 10.

    • Several template code patterns were found.

    • The development environment is configured.

    Test coverage

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

    • Deployment and basic user interactions are covered with tests.

    • ERC4626 test coverage is missed.

    • Interactions by several users are not tested thoroughly.

    Security score

    Upon auditing, the code was found to contain 0 critical, 1 high, 1 medium, and 5 low severity issues, leading to a security score of 4 out of 10. All significant findings were resolved during the remediation phase. The security score increased to 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.4. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    The minter_burn_from() function allows accounts, whitelisted by the contract managers to burn eMetis tokens of any account.

    The unstake() function has modifier forUser which prevent users from calling it when the protocol is paused. This way ENKI tokens can be temporarily withheld from users.

    There is no safeguard against price manipulation on seMetis contract.

    The RewardDispatcher contract grants unlimited approval to eMetisMinter contract. That contract can consume all eMetis tokens from RewardDispatcher contract.

    There is a couple of centralization risks on Config contracts. Timelock and Operator roles can change vesting configuration while its already active.

    Findings

    F-2024-1063Price manipulation on the first liquidation
    Status
    fixed
    Severity

    High
    F-2024-1101The contract managers are able to withdraw tokens from the contracts
    Status
    fixed
    Severity

    Medium
    F-2024-1079Dealer.lockFor() and Dealer.setActive() functions do not check previous agent entries
    Status
    fixed
    Severity

    Low
    F-2024-1071Owner can renounce its ownership
    Status
    fixed
    Severity

    Low
    F-2024-1068Risk of centralization due to authority of Timelock and Operator roles in Vesting settings
    Status
    accepted
    Severity

    Low
    F-2024-1066Timelock and Operator roles can renounce their permissions
    Status
    fixed
    Severity

    Low
    F-2024-1064Unlimited approval granted to unrelated contract
    Status
    fixed
    Severity

    Low
    F-2024-1077For loop optimizations
    Status
    accepted
    Severity

    Observation
    F-2024-1076Unused imports
    Status
    fixed
    Severity

    Observation
    F-2024-1074Floating pragma
    Status
    fixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2024-1063Price manipulation on the first liquidation
    fixed

    High
    F-2024-1101The contract managers are able to withdraw tokens from the contracts
    fixed

    Medium
    F-2024-1079Dealer.lockFor() and Dealer.setActive() functions do not check previous agent entries
    fixed

    Low
    F-2024-1071Owner can renounce its ownership
    fixed

    Low
    F-2024-1068Risk of centralization due to authority of Timelock and Operator roles in Vesting settings
    accepted

    Low
    F-2024-1066Timelock and Operator roles can renounce their permissions
    fixed

    Low
    F-2024-1064Unlimited approval granted to unrelated contract
    fixed

    Low
    F-2024-1077For loop optimizations
    accepted

    Observation
    F-2024-1076Unused imports
    fixed

    Observation
    F-2024-1074Floating pragma
    fixed

    Observation
    1-10 of 16 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/ENKIXYZ/lsd-contracts/tree/v2/contracts→
    Commit934933fc5963075ab6cbfa3a13bcf17b36480268
    Remediation Commitaddd1fd48d70a68ce6366088ab8fe80abd983a3b
    WhitepaperN/A
    RequirementsN/A
    Technical RequirementsN/A

    Contracts in Scope

    Base.sol - Base.sol
    Config.sol - Config.sol
    EMetis.sol - EMetis.sol
    EMetisMinter.sol - EMetisMinter.sol
    ERC20PermitPermissionedMint.sol - ERC20PermitPermissionedMint.sol
    RewardDispatcher.sol - RewardDispatcher.sol
    SeMetis.sol - SeMetis.sol
    Vesting.sol - Vesting.sol
    L1
    Dealer.sol - L1 › Dealer.sol
    SequencerAgent.sol - L1 › SequencerAgent.sol
    interfaces
    *.sol - interfaces › *.sol

    Disclaimer