V12 Docs
Launch Spark
  • Overview
  • Trade
    • πŸš€ Getting Started as a Trader
      • Wallet Setup
        • Fuel Wallet
        • Fuelet Wallet
        • Ethereum Wallets
      • Bridging Assets Using the Fuel Bridge
      • Deposit Assets using Testnet Faucet
      • Creating Orders
        • Order Book
          • Limit Order
          • Market Order
          • Cancelling an order
        • Swap
      • Fee Structure
  • Provide Liquidity
    • πŸ“ˆ Getting Started as a Market Maker
      • Market Maker Incentive Program
      • Fee Structure
      • SLAs for Market Makers
  • Build
    • πŸ‘©β€πŸ’» Getting Started as a Developer
      • Rust Integration Guide
        • Fuel and V12 Market Setup Tutorial
        • V12 Rust SDK
      • TypeScript SDK
      • Data Indexing
        • Envio Indexer Setup Guide
        • Indexer Queries
        • Connecting to the indexer via WebSocket
      • Order Book Technical Reference
  • Security
    • πŸ” Audit Report
  • More
    • πŸ—οΈ V12 Architecture Overview
    • πŸ† Point Rewards Program
    • βš–οΈ Terms
  • Community
    • Twitter
    • Telegram
    • Discord
    • GitHub
Powered by GitBook
On this page
  1. Security

πŸ” Audit Report

HashCloak Inc. conducted a security audit of Spark, a decentralized exchange (DEX) built on the Fuel blockchain. The audit revealed generally high-quality code but identified several areas for improvement, ranging from medium to informational severity.

Key Findings:

  • Medium Severity:

    1. Storage Update Issue: increase_user_volume function failed to persist changes, affecting protocol fee computation. (Resolved)

    2. Front-Running Vulnerability: Matching orders could be front-run, potentially undermining fairness. (Acknowledged)

  • Low Severity:

    1. Lack of restrictions on order input length in functions like match_order_many could lead to gas exhaustion. (Informed)

    2. Incorrect handling of GTC orders in fulfill_order_many led to unintended cancellations. (Resolved)

  • Informational Severity:

    1. Lack of documentation impedes auditability and maintenance. (Unresolved)

    2. Dead code and unused imports found in multiple places. (Partially resolved)

    3. Misleading function naming (log_order_change_info) suggests logging but doesn’t emit events. (Acknowledged for renaming)

    4. Redundant require statement in order_id function. (Unresolved)

Audit Methodology:

  • Static analysis using tools like sway-analyzer.

  • Manual code review.

  • Functional tests using Spark’s CLI and Fuel testnet deployment.

Severity Breakdown:

  • Critical: 0

  • High: 0

  • Medium: 2

  • Low: 2

  • Informational: 4

Recommendations:

  1. Enhance documentation for better clarity on functionality and fee structures.

  2. Address identified vulnerabilities, especially around front-running and input validations.

  3. Remove or refactor dead code and redundant checks.

  4. Improve clarity in function naming and ensure all significant actions emit appropriate logs.

Resolution Status: The Spark team has fixed all identified issues following the audit, ensuring the security and robustness of the protocol.

Full Report: Users can read the full report at the following link:

PreviousOrder Book Technical ReferenceNextπŸ—οΈ V12 Architecture Overview

Last updated 7 months ago