Coil DEX

// OFF-CHAIN INTENT DEX · BATCH SETTLEMENT · VYPER 0.4

A production-grade off-chain intent DEX built in Vyper 0.4, settling via batch auctions with partial fills. v6 addresses every critical finding from the v5 security review — including permit frontrun griefing, EIP-1271 smart wallet support, and chain.id replay protection.

Vyper 0.4.0 EIP-712 EIP-1271 EIP-2612 Moccasin Batch Auctions Partial Fills Hypothesis Fuzzing
639 Lines of Vyper
95 Tests
48 Asserts
8 Security Fixes

Architecture

Coil DEX uses an intent-settlement model. Users sign off-chain EIP-712 intents specifying token pairs, amounts, and price limits. An authorized solver assembles optimal batches and submits them on-chain via execute_batch(), which validates signatures, checks allowances, enforces price limits, and settles all transfers atomically.

v6 Security Fixes

All findings from the v5 review were resolved in this iteration:

ID Finding Resolution
F1Permit frontrun griefingrevert_on_failure=False + staticcall
F2fill_amt unboundedassert fill_amt < MAX_AMOUNT
F3ecrecover zero-ownerassert owner != empty(address)
F4Cancel fully-filledassert filled < sell_amount
F5No EIP-1271 supportisValidSignature + 0x1626ba7e
F6Static chain.idImmutable INITIAL_CHAIN_ID

Test Coverage

Key Features