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

Audit name:

[SCA] DragonX | Main | Jan2024

Date:

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

DragonX is a derivative of TitanX adoption, facilitates the creation of maximum-length TitanX stakes through publicly callable functions, utilizing Ethereum rewards to continuously purchase and burn TitanX off the market, while DragonX tokens serve as incentives for users max-staking their TitanX tokens during the launch phase.

titlecontent
PlatformDragonX
LanguageSolidity
TagsStaking, ERC20
Timeline11/01/2024 - 17/01/2024
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/DragonX2024888/DragonX→
    Commit95e66c5

    Audit Summary

    Total9.8/10
    Security Score

    10/10

    Test Coverage

    95.52%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    11Total Findings
    3Resolved
    0Accepted
    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 DragonX
    Audited ByKaan Caglan
    Approved ByAtaberk Yavuzer
    Websitehttps://dragonx.win/→
    Changelog15/01/2024 - Preliminary Report
    17/01/2024 - Final Report
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for DragonX
      Audited By
      Kaan Caglan
      Approved By
      Ataberk Yavuzer
      Changelog
      15/01/2024 - Preliminary Report
      17/01/2024 - Final Report

    System Overview

    DragonX is a derivative of TitanX adoption, facilitates the creation of maximum-length TitanX stakes through publicly callable functions, utilizing Ethereum rewards to continuously purchase and burn TitanX off the market, while DragonX tokens serve as incentives for users max-staking their TitanX tokens during the launch phase.

    DragonBuyAndBurn — a contract that swaps the cumulated ETH in the contract to DragonX and burns them to regulate token value. %3 of the operated amount gets sent to the caller as an incentive.

    DragonX — is an ERC20 token contract that allows minting DragonX tokens for users exchanging TitanX tokens. The contract also manages the allocation of rewards, handles the deployment of new DragonStake instances, and enables the contract owner to claim accumulated assets from a Genesis Vault. DragonX token price differs by time and the price ratio once the mint phase is started is as followed:

    • Week 1  1 TitanX : 1 DragonX

    • Week 2 1 TitanX : 1 DragonX

    • Week 3  1 TitanX : 0.95 DragonX

    • Week 4 1 TitanX : 0.90 DragonX

    • Week 5  1 TitanX : 0.85 DragonX

    • Week 6  1 TitanX : 0.80 DragonX

    • Week 7  1 TitanX : 0.75 DragonX

    • Week 8 1 TitanX : 0.70 DragonX

    • Week 9 1 TitanX : 0.65 DragonX

    • Week 10 1 TitanX : 0.60 DragonX

    • Week 11  1 TitanX : 0.55 DragonX

    • Week 12  1 TitanX : 0.50 DragonX

    DragonX token has the following attributes:

    • Name: DragonX

    • Symbol: DRAGONX

    • Decimals: 18

    • Total supply: N/A - no max cap

    TitanBuy — a contract that receives ETH rewards based on TitanX stakes from DragonX contract. 44.5% of the earned rewards from staking is sent to TitanBuy contract.

    TitanBuy swaps the received Eth for TitanX and sends it to the DragonX's vault. Caller of this swap operation in the TitanBuy contract is eligible to get %3 of the amount as an incentive to cover Gas fees.

    DragonStake — a staking management contract that is created by DragonX contract. A new DragonStake instance is deployed whenever the number of open stakes in the current active instance exceeds the maximum allowed per wallet.

    OracleLibrary — a library that helps to calculate the time-weighted means of tick and liquidity for a specified Uniswap V3 pool, based on observations made in the past.

    PoolAddress — a library that provides functionality to compute the address of a Uniswap V3 pool based on the factory, tokens, and fee.

    TickMath — a library that facilitates the precise calculation of square root prices based on tick values, and reciprocally, to determine the corresponding tick values for given square root prices.

    Constants — a Solidity file that establishes various constants and parameters for the TitanX protocol and its associated functionalities. It defines numerical values, such as scaling factors and time-related constants, as well as specific parameters related to TitanX staking, bonus structures, and Uniswaprelated addresses and liquidity pools.

    Types — A simple enumerator to indicate the initial liquidity for the DragonX / TitanX pool has been minted.

    Privileged roles

    • The owner of the DragonBuyAndBurn contract can:

      • create the initial liquidity for DragonX/TitanX

      • set the address of the DragonX contract

      • set the cap per swap set the slippage percentage

      • set the buy and burn interval

      • set the average time to use in TWAP calculations of TitanX and DragonX

    • The owner of DragonX contract can:

      • set the DRAGONXBUYAND_BURN address

      • set the TitanBuy address

      • withdraws the assets that are collected for the genesis vault

    • The owner of the TitanBuy contract can:

      • set the DragonX address

      • set the cap per swap

      • set the slippage percentage

      • set the slippage percentage

      • set the buy and burn interval

      • set the average time to use in TWAP calculations of TitanX

    Executive Summary

    Documentation quality

    The total Documentation Quality score is 10 out of 10.

    • Functional requirements are provided

    • Technical description is provided.

    • NatSpec is sufficient.

    Code quality

    The total Code Quality score is 10 out of 10.

    • The code follows the Solidity best practices.

    Test coverage

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

    • Not all branches are covered with tests.

    Security score

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

    Risks

    The implementation of if (msg.sender != tx.origin) in the buyAndBurnDragonX, claim and buyTitanX functions introduces a significant limitation, preventing these functions from being executed through any multisig wallet. This restriction could lead to reduced flexibility and potential operational inefficiencies for users relying on multisig wallets for enhanced security.

    Findings

    F-2024-0459Use private Rather Than public For Constants
    Status
    unfixed
    Severity

    Observation
    F-2024-0437Event is not properly indexed
    Status
    unfixed
    Severity

    Observation
    F-2024-0436Style Guide Violation
    Status
    unfixed
    Severity

    Observation
    F-2024-0435Remove hardhat import
    Status
    unfixed
    Severity

    Observation
    F-2024-0434Public Functions That Should Be External
    Status
    unfixed
    Severity

    Observation
    F-2024-0433Owner Can Renounce Ownership
    Status
    unfixed
    Severity

    Observation
    F-2024-0432Cache State Variables
    Status
    unfixed
    Severity

    Observation
    F-2024-0431Unused Error Definition
    Status
    fixed
    Severity

    Observation
    F-2024-0430Custom Errors in Solidity for Gas Efficiency
    Status
    unfixed
    Severity

    Observation
    F-2024-0427Use Ownable2Step rather than Ownable
    Status
    fixed
    Severity

    Observation
    Code
    ―
    Title
    Status
    Severity
    F-2024-0459Use private Rather Than public For Constants
    unfixed

    Observation
    F-2024-0437Event is not properly indexed
    unfixed

    Observation
    F-2024-0436Style Guide Violation
    unfixed

    Observation
    F-2024-0435Remove hardhat import
    unfixed

    Observation
    F-2024-0434Public Functions That Should Be External
    unfixed

    Observation
    F-2024-0433Owner Can Renounce Ownership
    unfixed

    Observation
    F-2024-0432Cache State Variables
    unfixed

    Observation
    F-2024-0431Unused Error Definition
    fixed

    Observation
    F-2024-0430Custom Errors in Solidity for Gas Efficiency
    unfixed

    Observation
    F-2024-0427Use Ownable2Step rather than Ownable
    fixed

    Observation
    1-10 of 11 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/DragonX2024888/DragonX→
    Commit95e66c52a3cac7991f4d4cf51a9897d131eb95bb
    WhitepaperNot provided
    RequirementsProvided
    Technical RequirementsProvided

    Contracts in Scope

    contracts
    DragonX.sol - contracts › DragonX.sol
    DragonBuyAndBurn.sol - contracts › DragonBuyAndBurn.sol
    TitanBuy.sol - contracts › TitanBuy.sol
    lib
    DragonStake.sol - contracts › lib › DragonStake.sol
    Constants.sol - contracts › lib › Constants.sol
    interfaces
    IWETH.sol - contracts › lib › interfaces › IWETH.sol
    ITitanX.soL - contracts › lib › interfaces › ITitanX.soL
    INonfungiblePositionManager.sol - contracts › lib › interfaces › INonfungiblePositionManager.sol
    Types.sol - contracts › lib › Types.sol
    uniswap
    PoolAddress.sol - contracts › lib › uniswap › PoolAddress.sol

    Disclaimer