Security Overview

Security is foundational to the YoorQuezt MEV platform. This document covers smart contract security patterns, audit status, infrastructure security layers, testing coverage, and the roadmap for external audits and formal verification.

Smart Contract Security Patterns

All settlement contracts implement industry-standard security patterns:

PatternPurposeContracts
Ownable2StepTwo-step ownership transfer (propose + accept) prevents accidental lossAll contracts
ReentrancyGuardPrevents reentrancy attacks on all ETH-transferring functionsAuctionSettlement, RebateDistributor, IntentRegistry
PausableEmergency pause capability halts all operationsAll contracts
SafeERC20Safe token transfer wrappers for non-standard ERC20 (USDT, BNB)All contracts
MerkleProofEfficient on-chain verification of off-chain computationsRebateDistributor
Address validationZero-address checks on all setters and constructorsAll contracts
Pull over pushUsers claim funds instead of automatic distributionAuctionSettlement, RebateDistributor
Arithmetic safetySolidity 0.8.x built-in overflow/underflow protectionAll contracts
Fund isolationPer-epoch and per-auction accounting prevents cross-contaminationAuctionSettlement, RebateDistributor

Deployed Contracts

ContractPurposeChainAddressStatus
ArbExecutorTwo-leg arbitrage (V2/V3 routers)Ethereum0xF3a2...Deployed, verified
ArbExecutorTwo-leg arbitrage (V2/V3 routers)Arbitrum0xEDFD...Deployed, verified
AuctionSettlementSealed-bid auction settlementSepolia(testnet)Pre-external audit
RebateDistributorMerkle-proof MEV rebatesSepolia(testnet)Pre-external audit
IntentRegistryIntent submission + solver stakingSepolia(testnet)Pre-external audit

Mainnet deployment of settlement contracts is pending external audit completion.

Audit Status

Internal Audit (March 2026)

SeverityFoundFixedRemaining
Critical000
High880
Medium550
Low12120
Informational770
Total32320

All 8 HIGH findings were resolved internally:

  1. Missing reentrancy guard on claimPayout -- added nonReentrant modifier
  2. Unchecked return value on ERC20 transfer -- switched to SafeERC20
  3. Missing zero-address check on solver registration -- added validation
  4. Potential front-running on sealed-bid reveal -- implemented commit-reveal scheme
  5. Missing pause checks on critical functions -- added whenNotPaused
  6. Integer overflow in fee calculation -- covered by Solidity 0.8+ built-in checks
  7. Missing event emissions on state changes -- added events for all mutations
  8. Stale epoch data not cleaned up -- added recoverExpired function

External Audit

External audit is deferred pending funding ($10-25K estimated cost). The RFP is prepared at docs/audit-rfp.md.

Scope:

  • AuctionSettlement.sol (~350 LOC)
  • RebateDistributor.sol (~280 LOC)
  • IntentRegistry.sol (~320 LOC)
  • Deploy scripts and configuration

Settlement Security Model

The settlement layer uses a sealed-bid auction model:

  1. Deposit -- searchers deposit ETH as bidding collateral into AuctionSettlement.
  2. Commit -- bids are committed as hashes (commit-reveal prevents front-running).
  3. Reveal -- bids are revealed and validated against commitments.
  4. Settle -- winner is determined, funds are transferred, protocol fee is locked per-auction.
  5. Claim -- winner claims payout via pull pattern (no automatic push distribution).

Security properties:

  • Bids are hidden until reveal phase (sealed-bid).
  • Deposits are locked until settlement or withdrawal window.
  • Protocol fees are capped (MAX_FEE_BPS = 2000, i.e., 20%) and locked at settlement time.
  • Emergency pause halts all operations.
  • Two-step ownership prevents accidental admin transfer.

Infrastructure Security

LayerMechanismPurpose
TransportQUIC + TLS 1.3Authenticated encryption, forward secrecy, 0-RTT
Application EncryptionAES-256-GCM (optional)Defense-in-depth payload encryption (see Encryption Toggle)
Message IntegrityECDSA P-256 signingAuthenticity and non-repudiation on all gossip messages
DeduplicationBloom filterPrevents replay and amplification attacks
AuthenticationBearer tokensAPI key per-searcher with role-based rate limiting
MonitoringPrometheus + Grafana + LokiGas spikes, failed bundles, relay errors, log aggregation
TracingOpenTelemetry + TempoLatency anomalies, distributed trace correlation

Audit Trail

Every MEV capture and rebate payout is recorded in a tamper-evident audit log:

  • SHA256 proof hashes for all settlements
  • On-chain events for all state changes
  • Originators can verify rebates via /v1/ofa/audit/verify endpoint
  • Bundle lifecycle logging (submitted, simulated, landed, failed)
  • Solver registration, matching, and slashing events
  • Configuration changes and emergency pause/unpause events

Testing Coverage

ComponentTestsCoverage Notes
Solidity contracts (Foundry)96All functions, edge cases, access control, fuzz testing (256 local / 1024 CI)
MEV engine (Go)1,246Unit (counterfeiter fakes), smoke, integration (httptest), E2E (Docker)
Mesh network (Go)200+Unit, integration (testcontainers), E2E (testnet with live chains)
TypeScript SDK89Client, gateway, streaming, errors across 5 test suites
Python SDK75+Client, gateway, models, utils

Test methodologies:

  • Unit tests -- counterfeiter fakes for interfaces, table-driven subtests
  • Smoke tests -- lightweight validation without external dependencies
  • Integration tests -- httptest servers, testcontainers (Docker)
  • E2E tests -- Docker containers with real services, testnet connectors with live chains
  • Race detection -- go test -race on all Go packages
  • Fuzz testing -- Foundry fuzz on contract boundary conditions

External Audit Timeline

PhaseScopeTimelineEst. Cost
Phase 1ArbExecutor (deployed, handles funds)Q2 2026$10-15K
Phase 2Settlement contracts (pre-mainnet)Q3 2026$15-25K
Phase 3Full re-audit after mainnet deploymentQ4 2026$20-30K

Security Roadmap

QuarterMilestones
Q2 2026External audit RFP distribution, auditor selection, ArbExecutor audit, formal verification of AuctionSettlement invariants
Q3 2026Settlement contracts external audit, findings remediation, mainnet deployment, bug bounty program launch (Immunefi)
Q4 2026Multisig migration for contract ownership (Gnosis Safe, see docs/multisig-migration.md), SOC 2 Type I assessment, timelock on admin operations (24h delay), full system re-audit

Responsible Disclosure

If you discover a security vulnerability, please report it responsibly:

  • Email: security@yoorquezt.io
  • Do not disclose publicly until a fix is deployed.
  • Include reproduction steps and impact assessment.
  • We aim to respond within 48 hours and resolve critical issues within 7 days.

Bug Bounty (Planned Q3 2026)

SeverityScopeReward
CriticalFund loss, unauthorized accessUp to $50,000
HighProtocol disruption, privilege escalationUp to $20,000
MediumData leak, DoS, griefingUp to $5,000
LowInformational, best practicesUp to $1,000

Scope will include smart contracts, API endpoints, and P2P protocol. Program hosted on Immunefi.

Edit this page