Prepared by:
HALBORN
Last Updated 12/03/2025
Date of Engagement: November 6th, 2025 - November 14th, 2025
100% of all REPORTED Findings have been addressed
All findings
9
Critical
1
High
0
Medium
1
Low
1
Informational
6
Casper Association engaged Halborn to conduct a security assessment of the Casper Trade smart contracts, beginning on November 6th, 2025 and ending on November 14th, 2025. This security assessment was scoped to the smart contracts in the casper-trade GitHub repository based on the Odra framework version 2.4.1.
The engagement involved a detailed, line-by-line security review of all core modules that compose the Casper Trade DEX, a Uniswap V2–style automated market maker (AMM) implemented in Rust for the Casper network. The assessment included review of the Factory, Pair, and Router modules, as well as auxiliary components such as the Callee interface, SampleToken (CEP-18 implementation), utility helpers, and CLI deployment scripts.
Halborn's team of blockchain security specialists conducted a rigorous smart contract audit of the Casper Trade DEX architecture. The review was performed over a 9-day period by experts in Web3 security and Rust-based frameworks for Casper. The primary goal was to evaluate the security and correctness of the AMM core logic, pair creation flow, liquidity management, and routing mechanisms.
In summary, Halborn identified some improvements to reduce the likelihood and impact of risks, which have been completely addressed by the Odra team. The main ones were the following:
Add strict access control to set/update the protocol fee receiver (and validate the destination), emit events, and add tests to prevent unauthorized fee redirection/theft.
Enforce a canonical token order (e.g., sort by address) or remap inputs before computing shares/reserves to prevent reserve mismatches and price distortion.
Validate create_pair inputs to reject zero or identical token addresses and revert with explicit errors, plus unit tests.
Add decimal-adjustment getters and unique LP token identifiers to ensure correct TWAP interpretation and distinguishable liquidity tokens across pairs.
Replace misleading authorization errors with explicit ones, standardize pair labeling to match canonical token order, and add clear revert messages in the initial mint.
Emit events for critical operations such as skim and fee updates to enhance auditability, monitoring, and protocol transparency.
Halborn employs a combined approach of manual code review and automated security testing to ensure a comprehensive and practical evaluation of smart contract security and correctness. Manual review focuses on identifying logic flaws, process weaknesses, and unsafe assumptions, while automated tools provide broad coverage and static analysis support.
The following phases and tools were utilized during the assessment:
Research and documentation review to understand the Odra architecture, DEX purpose, and module relationships.
Manual inspection of Rust source code for all key modules (Factory, Pair, Router, Callee, SampleToken, utils).
Manual validation of state variables, entry points, and Odra annotations.
Verification of cross-module call integrity and state consistency during liquidity and swap operations.
Review of arithmetic operations, invariant maintenance (K-product), and price accumulator updates.
Automated static scanning of dependencies using cargo audit and code hygiene checks.
Analysis and execution of existing unit and integration tests to confirm functional behavior.
| EXPLOITABILITY METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Attack Origin (AO) | Arbitrary (AO:A) Specific (AO:S) | 1 0.2 |
| Attack Cost (AC) | Low (AC:L) Medium (AC:M) High (AC:H) | 1 0.67 0.33 |
| Attack Complexity (AX) | Low (AX:L) Medium (AX:M) High (AX:H) | 1 0.67 0.33 |
| IMPACT METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Confidentiality (C) | None (C:N) Low (C:L) Medium (C:M) High (C:H) Critical (C:C) | 0 0.25 0.5 0.75 1 |
| Integrity (I) | None (I:N) Low (I:L) Medium (I:M) High (I:H) Critical (I:C) | 0 0.25 0.5 0.75 1 |
| Availability (A) | None (A:N) Low (A:L) Medium (A:M) High (A:H) Critical (A:C) | 0 0.25 0.5 0.75 1 |
| Deposit (D) | None (D:N) Low (D:L) Medium (D:M) High (D:H) Critical (D:C) | 0 0.25 0.5 0.75 1 |
| Yield (Y) | None (Y:N) Low (Y:L) Medium (Y:M) High (Y:H) Critical (Y:C) | 0 0.25 0.5 0.75 1 |
| SEVERITY COEFFICIENT () | COEFFICIENT VALUE | NUMERICAL VALUE |
|---|---|---|
| Reversibility () | None (R:N) Partial (R:P) Full (R:F) | 1 0.5 0.25 |
| Scope () | Changed (S:C) Unchanged (S:U) | 1.25 1 |
| Severity | Score Value Range |
|---|---|
| Critical | 9 - 10 |
| High | 7 - 8.9 |
| Medium | 4.5 - 6.9 |
| Low | 2 - 4.4 |
| Informational | 0 - 1.9 |
Critical
1
High
0
Medium
1
Low
1
Informational
6
| Security analysis | Risk level | Remediation Date |
|---|---|---|
| Missing access control on fee receiver allows protocol fee theft | Critical | Solved - 11/20/2025 |
| Reversed token order causes reserve mismatch in add_liquidity | Medium | Solved - 11/24/2025 |
| Factory allows creating pairs with zero or identical token addresses | Low | Solved - 11/24/2025 |
| Missing decimal-adjustment metadata for TWAP consumers | Informational | Solved - 11/27/2025 |
| Misleading authorization error on Pair.initialize | Informational | Solved - 12/03/2025 |
| Undistinguishable LP token metadata across all pairs | Informational | Solved - 12/03/2025 |
| Missing error handling in initial mint | Informational | Solved - 11/24/2025 |
| Non-canonical pair order on deployment label | Informational | Solved - 11/24/2025 |
| Missing events on critical state changes reduces auditability and monitoring | Informational | Solved - 11/26/2025 |
//
//
//
//
//
//
//
//
//
Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.
// Download the full report
Odradev/Casper- Trade
* Use Google Chrome for best results
** Check "Background Graphics" in the print settings if needed