Agentic MarketAgentic Market Docs
Security & Audits

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

SeverityIdentifiedFixedAcknowledgedOpen
Critical0000
High0000
Medium3300
Low2200
Informational1010
Total6510

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

IDSeverityIssue & FixRegression Test
M-01MediumPaused 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-02MediumPaused 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-03MediumA 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-01LowTightening maxOutflowPerWindow via setVaultLimits() could temporarily leave bucketLevel > maxOutflowPerWindow. Fix: Decay and clamp bucketLevel inside setVaultLimits().test_Regression_L01_SetVaultLimitsClampsBucketLevel
L-02LowMaxPositionExceeded 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-01InfoSwept 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 / 58 passing across 9 test suites.
  • Deep Stateful 11-Invariant Campaign: Verified across 131,072 to 204,800 interleaved cross-market calls (1,024–1,600 runs × 128 depth) with 0 invariant violations, 0 discards, simulated mid-fuzz AdapterRegistry outages, and unsolicited 1-wei USDT donations.
  • Assembly & Low-Level Review: Every assembly ("memory-safe") block (MarketKeyLib.hash, hashMemory, emitMarketCreated, AdapterRegistry bounded staticcall) and every unchecked block 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.)