Skip to content

Add user-directed Router - #21

Open
1kresh wants to merge 11 commits into
stagefrom
codex/router
Open

Add user-directed Router#21
1kresh wants to merge 11 commits into
stagefrom
codex/router

Conversation

@1kresh

@1kresh 1kresh commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the ownerless Router contract for atomic user-directed multi-solver execution.
  • Defines SwapCall as exactly (adapter, amountIn, data).
  • For each leg, checks that the target is registered by LIQUID_LANE_ADAPTER_FACTORY, transfers input directly from the caller to that adapter, and invokes the supplied calldata inline.
  • After all legs, transfers declared ERC-20 outputs to recipients in caller-supplied order.
  • Keeps the no-deadline and deadline execute overloads, constructor factory validation, SafeERC20, ReentrancyGuard, deployment script, documentation, and Foundry tests.

Deliberately minimal trust boundary

  • The Router does not inspect adapter selectors or signatures and therefore supports both signed-swap and discounted-swap calldata.
  • It does not validate amount sums, token/recipient fields, input consumption, balance deltas, or surplus.
  • Output transfers use the Router's current balances; undeclared surplus remains in the Router.
  • Registered adapters remain responsible for selector, signature, nonce, quote, recipient/caller, and deadline validation.
  • Any failed registry lookup, transfer, adapter call, output transfer, reentrant call, or expired Router deadline reverts the whole batch atomically.

Companion PRs: symbioticfi/rfq-backend#292 and symbioticfi/vault-solver#116.

Verification

  • Solidity 0.8.28 Foundry suite: 37 tests passing
  • Router fuzz test: 10,000 runs
  • forge fmt --check, focused lint, and build pass in the dependency harness

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant