feat: integrate Deepstate settlement on Robinhood Chain - #640
dangerousfood wants to merge 2 commits into
Conversation
Add a chain-scoped Settler action for the canonical Deepstate engine with direct-route validation, exact bounded input accounting, unmatched-input refunds, no-rest enforcement, generic-call isolation, and live-fork coverage. Co-Authored-By: OpenAI Codex <codex@openai.com>
🛡️ Immunefi PR ReviewsWe noticed that your project isn't set up for automatic code reviews. If you'd like this PR reviewed by the Immunefi team, you can request it manually using the link below: Once submitted, we'll take care of assigning a reviewer and follow up here. |
Size each Deepstate action from the selected current balance, use one no-rest book fill per action, and bound engine spending with exact temporary approvals. Add bid, overflow, and live-fork coverage. Co-Authored-By: OpenAI Codex <codex@openai.com>
|
Addressed the fill-resizing concern in The action now represents exactly one Deepstate book fill and sizes it from the current Settler balance at execution time. Asks use the selected token0 amount directly. Bids convert the selected token1 budget with Every call hardcodes I added 100,000-run ask and bid fuzz tests, overflow/packing and exact-spend tests, plus live deployed-engine coverage for both an ask and a nonzero-price bid consuming multiple resting asks. The full local suite is green, and the Robinhood Settler retains 3,574 bytes of EIP-170 margin. |
Summary
Adds a chain-scoped
DEEPSTATEself-funded action to Robinhood Settler for the canonical Deepstate V1 engine at0x6cf19308C22FC82ea620Fa0B3E94948d20f27B96.token0/token1from the action assetsnoRest = trueandfillOrKill = falseRouter encoding
For a bid,
inversePriceX128isfloor(2**128 / price(tick)), whereprice(tick) = 2 ** (96 * tick / 2**31). It is ignored for asks. The value is derived from the selected limit tick during route construction; it does not require an onchain quote.Each action contains one pair/book. A route can compose multiple independently resized actions without forwarding a caller-authored Deepstate fill array.
Security boundaries
BASICcalls so validation andnoRestcannot be bypasseduint160without corrupting the signed tick fieldVerification
52,936,000: 2/2 passed against the deployed enginenoRestassertionsGas Optimization
RobinHoodSettler: 21,002 runtime bytes, 3,574-byte EIP-170 marginRobinHoodSettlerIntent: 19,696 runtime bytes, 4,880-byte marginRobinHoodSettlerMetaTxn: 18,889 runtime bytes, 5,687-byte marginfillcall and avoids copying a dynamic fill array