π 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:
Storage Update Issue:
increase_user_volume
function failed to persist changes, affecting protocol fee computation. (Resolved)Front-Running Vulnerability: Matching orders could be front-run, potentially undermining fairness. (Acknowledged)
Low Severity:
Lack of restrictions on order input length in functions like
match_order_many
could lead to gas exhaustion. (Informed)Incorrect handling of GTC orders in
fulfill_order_many
led to unintended cancellations. (Resolved)
Informational Severity:
Lack of documentation impedes auditability and maintenance. (Unresolved)
Dead code and unused imports found in multiple places. (Partially resolved)
Misleading function naming (
log_order_change_info
) suggests logging but doesnβt emit events. (Acknowledged for renaming)Redundant
require
statement inorder_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:
Enhance documentation for better clarity on functionality and fee structures.
Address identified vulnerabilities, especially around front-running and input validations.
Remove or refactor dead code and redundant checks.
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:
Last updated