V1 BinaryEngine Audit Report
Executive summary, remediated findings (M-01 through L-02), assembly verification, and deep invariant fuzzing results for BinaryEngine V5.0.
An adversarial line-by-line security audit, assembly memory-safety review, differential ABI verification, and deep stateful invariant campaign were completed on BinaryEngine, EngineBase, AdapterRegistry, and all five core libraries.
Severity Summary & Verdict
| Severity | Identified | Fixed | Acknowledged | Open |
|---|---|---|---|---|
| Critical | 0 | 0 | 0 | 0 |
| High | 0 | 0 | 0 | 0 |
| Medium | 3 | 3 | 0 | 0 |
| Low | 2 | 2 | 0 | 0 |
| Informational | 1 | 0 | 1 | 0 |
| Total | 6 | 5 | 1 | 0 |
Audit Verdict: PASS (Testnet & Integration Cleared)
Zero Critical or High vulnerabilities were found. All 5 actionable Medium and Low findings were fixed and locked with regression tests while keeping BinaryEngine safely under the EIP-170 24,576 B limit (24,076 B, 500 B margin).
Remediated Findings
| ID | Severity | Issue & Fix | Regression Test |
|---|---|---|---|
| M-01 | Medium | Paused price markets previously allowed non-Void optimistic proposals, bypassing Chainlink. Fix: Unconditionally restricted non-VOID_OUTCOME proposals to TREND_BINARY markets past cutoffTime. | test_Regression_M01_PausedPriceMarketRejectsNonVoidProposal |
| M-02 | Medium | Paused trend markets allowed non-Void proposals prior to cutoffTime. Fix: Unified in the same outcome != VOID_OUTCOME check requiring block.timestamp >= key.cutoffTime. | test_Regression_M02_PausedTrendBeforeCutoffRejectsNonVoidProposal |
| M-03 | Medium | A proposer could self-dispute their own proposal to lock out honest third-party disputers. Fix: Added if (msg.sender == res.proposer) revert EngineErrors.AlreadyProposed();. | test_Regression_M03_ProposerCannotSelfDispute |
| L-01 | Low | Tightening maxOutflowPerWindow via setVaultLimits() could temporarily leave bucketLevel > maxOutflowPerWindow. Fix: Decay and clamp bucketLevel inside setVaultLimits(). | test_Regression_L01_SetVaultLimitsClampsBucketLevel |
| L-02 | Low | MaxPositionExceeded cast newBasis to uint40, risking payload truncation on extreme inputs. Fix: Widened to MaxPositionExceeded(uint256 newBasis, uint40 cap) and re-exported Viem ABIs. | Confirmed via ABI export & forge test |
| I-01 | Info | Swept emits proposerReward = 0 on fallback path (reward credited directly to bondFree[proposer] before _sweepCore to save bytecode). Status: Acknowledged; ledger accounting 100% verified by INV-1. | Covered by INV-1 & Attack08 |
Deep Invariant Fuzzing Results
- Unit, Gas, Attack & Regression Suites:
58 / 58passing across 9 test suites. - Deep Stateful 11-Invariant Campaign: Verified across
131,072to204,800interleaved cross-market calls (1,024–1,600runs ×128depth) with0invariant violations,0discards, simulated mid-fuzzAdapterRegistryoutages, and unsolicited 1-wei USDT donations. - Assembly & Low-Level Review: Every
assembly ("memory-safe")block (MarketKeyLib.hash,hashMemory,emitMarketCreated,AdapterRegistryboundedstaticcall) and everyuncheckedblock was verified against strict memory and bit-width bounds.
(The complete unabridged audit report is preserved in Git at docs/security/audit-report-v1-binary-engine.md.)
11 Mandatory Invariants & Testing
Formal mathematical invariants (INV-1 through INV-11), 16+ adversarial attack tests, and stateful cross-market Foundry fuzzing.
Responsible Disclosure
Security reporting process, in-scope targets, safe harbor guidelines, and coordinated vulnerability disclosure policy for Agentic Market.