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

Audit name:

[SCA] EverValue Coin | OrderBook | Nov2024

Date:

Dec 31, 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 EverValue Coin team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

EverValue Coin (EVA) is a new token with real value in bitcoins because it is fully backed by Bitcoins. It has a unique and final issuance of 21 million, making it better than Bitcoin in this aspect. It operates in a "smart contract" wallet where new bitcoins are deposited daily but can only be withdrawn by burning EVA tokens.

Document

NameSmart Contract Code Review and Security Analysis Report for EverValue Coin
Audited BySeher Saylik, Andy Cho
Approved ByAtaberk Yavuzer
Websitehttps://evervaluecoin.com/→
Changelog10/12/2024 - Preliminary Report
Changelog11/02/2025 - Final Report
PlatformArbitrum network
LanguageSolidity
TagsOrderBook, ERC-20, DEX
Methodologyhttps://hackenio.cc/sc_methodology→
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for EverValue Coin
    Audited By
    Seher Saylik, Andy Cho
    Approved By
    Ataberk Yavuzer
    Changelog
    10/12/2024 - Preliminary Report
    Changelog
    11/02/2025 - Final Report
    Platform
    Arbitrum network
    Language
    Solidity
    Tags
    OrderBook, ERC-20, DEX

Review Scope

Repositoryhttps://github.com/devervalue/orderbook→
Commitc591236

Audit Summary

10Total Findings
8Resolved
2Accepted
0Mitigated

The system users should acknowledge all the risks summed up in the risks section of the report

During the audit, five issues were identified: two high, two medium, and one low. The development team promptly addressed and resolved two high, one medium, and one low-severity issue, which were subsequently retested and approved in the final review. One medium-severity issue is acknowledged, as the team confirmed they will not use fee-on-transfer functionality.

This report reflects the final state of the code after all necessary fixes and improvements were implemented.

Documentation quality

  • Functional requirements are provided.

  • Technical description is provided.

Code quality

  • 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.

  • Negative cases coverage is covered.

  • Interactions by several users are tested thoroughly.

System Overview

The OrderBook Smart Contract is an on-chain decentralized exchange (DEX) implementation that aims to provide a fully transparent and efficient trading platform for ERC20 tokens. Unlike traditional Automated Market Maker (AMM) based DEXes, this system implements a limit order book model, similar to those used in centralized exchanges.

OrderBookFactory — main orderbook contract that manages the creation and administration of order books for trading pairs, allowing users to place and manage buy/sell orders efficiently. It supports features like adding new pairs, updating fees, pausing operations.

OrderBookLib — A library for managing an order book.

PairLib — A library designed for managing trading pairs and their associated order books in decentralized exchanges. It supports creating, canceling, and matching buy/sell orders while handling functionalities such as maintaining trader-specific registries, tracking order states, and calculating trading fees.

QueueLib — A library that implements a queue data structure.

RedBlackTreeLib — A library that implements a Red-Black Tree data structure.

Privileged roles

  • The owner role can add new pairs, change the enabled status for a trading pair, update the fee for a specific trading pair, set a new fee recipient address for a specific order book, and pause/unpause the contract.

Potential Risks

Insufficient Multi-signature Controls for Critical Functions: The lack of multi-signature requirements for key operations centralizes decision-making power, increasing vulnerability to single points of failure or malicious insider actions, potentially leading to unauthorized transactions or configuration changes.

The reliance on off-chain price management and user responsibility for accurate decimals handling introduces a potential risk of incorrect price submissions, which might result in token mispricing. Without on-chain validation or adjustment for token decimals, the system remains susceptible to errors or exploitation if backend systems or user inputs are compromised.

The matchOrder function's loop, while capped at 1500 iterations, poses a potential DoS risk as processing large orders involving numerous matching transactions could consume excessive gas. This may prevent the completion of order processing, disrupting contract operations for legitimate users.

Findings

F-2024-7557Stuck Order Matching Due to Blacklisted Addresses
Status
fixed
Severity

High
F-2025-8721Exploitable Order Quantity Leading to Fund Loss
Status
fixed
Severity

High
F-2024-7553Vulnerability to Fee-on-Transfer Accounting Issues
Status
accepted
Severity

Medium
F-2025-8551Rounding Issue in fillOrder and partiallyFillOrder Allows Free Token Transfer
Status
fixed
Severity

Medium
F-2024-7555Use Ownable2Step Rather Than Ownable
Status
fixed
Severity

Low
F-2024-7559Shortcircuit Rules Can Be Used To Optimize Some Gas Usage
Status
accepted
Severity

Observation
F-2024-7556Violation of Checks-Effects-Interactions (CEI) Pattern in cancelOrder()
Status
fixed
Severity

Observation
F-2024-7554Redundant Quantity Check in addNewOrder Function
Status
fixed
Severity

Observation
F-2024-7535Floating pragma
Status
fixed
Severity

Observation
F-2024-7531Remove console import
Status
fixed
Severity

Observation
Code
―
Title
Status
Severity
F-2024-7557Stuck Order Matching Due to Blacklisted Addresses
fixed

High
F-2025-8721Exploitable Order Quantity Leading to Fund Loss
fixed

High
F-2024-7553Vulnerability to Fee-on-Transfer Accounting Issues
accepted

Medium
F-2025-8551Rounding Issue in fillOrder and partiallyFillOrder Allows Free Token Transfer
fixed

Medium
F-2024-7555Use Ownable2Step Rather Than Ownable
fixed

Low
F-2024-7559Shortcircuit Rules Can Be Used To Optimize Some Gas Usage
accepted

Observation
F-2024-7556Violation of Checks-Effects-Interactions (CEI) Pattern in cancelOrder()
fixed

Observation
F-2024-7554Redundant Quantity Check in addNewOrder Function
fixed

Observation
F-2024-7535Floating pragma
fixed

Observation
F-2024-7531Remove console import
fixed

Observation
1-10 of 10 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/devervalue/orderbook→
Commitc591236aab86b61df2d23630b4b9d192db65a606
Retest commit151647111838bf904e2a9a27f8afc5575f9a2cc0
Whitepaperhttps://evervaluecoin.com/white-paper/→
Requirementshttps://github.com/devervalue/orderbook/blob/master/README.md→
Technical Requirementshttps://github.com/devervalue/orderbook/blob/master/README.md→
Deployed contractsOrderBookFactory - 0x03339ECAE41bc162DAcAe5c2A275C8f64D6c80A0 (Arbirtum Chain)

Assets in Scope

interface
IOrderBookFactory.sol - interface › IOrderBookFactory.sol
OrderBookFactory.sol - OrderBookFactory.sol
OrderBookLib.sol - OrderBookLib.sol
PairLib.sol - PairLib.sol
QueueLib.sol - QueueLib.sol
RedBlackTreeLib.sol - RedBlackTreeLib.sol

Appendix 3. Additional Valuables

Verification of System Invariants

During the audit of EverValue Coin, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry →, 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, 11 invariants were tested over 50,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.

Invariant

Test Result

Run Count

RedBlackTreeLib::insert. RedBlackTreeLib::remove should insert and remove consistenlyPassed50k
RedBlackTreeLib::remove multiple random removal should adjust the first price correctlyPassed50k
RedBlackTreeLib::next should bring the correct next pricePassed50k
RedBlackTreeLib::next should bring the correct prev pricePassed50k
PairLib::addBuyOrder add any orders successfullyPassed50k
PairLib::cancelOrder remove any orders successfullyPassed50k
OrderBookFactory::addPair add pairs successfullyPassed100k
OrderBookFactory::setPairStatus set the pair status successfullyPassed100k
OrderBookFactory::setPairFee set the pair fee successfullyPassed100k
OrderBookFactory::setPairFeeAddress set the pair fee address successfullyPassed100k
OrderBookFactory::addNewOrder add new orders successfullyPassed100k
  • Invariant

    RedBlackTreeLib::insert. RedBlackTreeLib::remove should insert and remove consistenly

    Test Result

    Passed

    Run Count

    50k

    Invariant

    RedBlackTreeLib::remove multiple random removal should adjust the first price correctly

    Test Result

    Passed

    Run Count

    50k

    Invariant

    RedBlackTreeLib::next should bring the correct next price

    Test Result

    Passed

    Run Count

    50k

    Invariant

    RedBlackTreeLib::next should bring the correct prev price

    Test Result

    Passed

    Run Count

    50k

    Invariant

    PairLib::addBuyOrder add any orders successfully

    Test Result

    Passed

    Run Count

    50k

    Invariant

    PairLib::cancelOrder remove any orders successfully

    Test Result

    Passed

    Run Count

    50k

    Invariant

    OrderBookFactory::addPair add pairs successfully

    Test Result

    Passed

    Run Count

    100k

    Invariant

    OrderBookFactory::setPairStatus set the pair status successfully

    Test Result

    Passed

    Run Count

    100k

    Invariant

    OrderBookFactory::setPairFee set the pair fee successfully

    Test Result

    Passed

    Run Count

    100k

    Invariant

    OrderBookFactory::setPairFeeAddress set the pair fee address successfully

    Test Result

    Passed

    Run Count

    100k

    Invariant

    OrderBookFactory::addNewOrder add new orders successfully

    Test Result

    Passed

    Run Count

    100k

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