Skip to content

refactor(lifi): split direct and discount routes - #20

Merged
1kresh merged 1 commit into
lifi-refactorfrom
lifi-split-routes
Jul 23, 2026
Merged

refactor(lifi): split direct and discount routes#20
1kresh merged 1 commit into
lifi-refactorfrom
lifi-split-routes

Conversation

@1kresh

@1kresh 1kresh commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Aligns the LI.FI executor with the RFQ executor (swapInputs/discountSwapInputs) and the UniswapX executor (routes/discountRoutes): direct-swap legs and discount-backed legs now live in separate arrays instead of one FillRoute array with an embedded optional FillDiscount.

Changes

  • ILiquidLaneLifiExecutor: removed FillDiscount (and discountId); FillRoute is now {adapter, amountIn, amountOut} and a new DiscountRoute {adapter, amountIn, discountSwap, protocolSignature} mirrors the UniswapX executor's struct. FillCall and finaliseWithCurrentTimestamp carry both arrays.
  • LiquidLaneLifiExecutor.orderFinalised: two loops in the UniswapX executor's style — transfer + direct swap() per route, then transfer + discount swap() per discount route — replacing the discountId == 0 branch.
  • Tests updated for the new signature; the discount test now exercises a discount-only fill, and a new testFinaliseWithCurrentTimestampExecutesDirectAndDiscountRoutes covers a mixed fill.

Verification

  • 34/34 lifi tests pass, including the Sepolia fork test against the deployed InputSettlerEscrow
  • Full suite: 103 passed, 0 failed
  • forge fmt --check clean

🤖 Generated with Claude Code

Replace the single FillRoute array with embedded optional FillDiscount
by separate FillRoute[] routes and DiscountRoute[] discountRoutes,
matching the RFQ executor (swapInputs/discountSwapInputs) and the
UniswapX executor (routes/discountRoutes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@1kresh
1kresh merged commit 96848f0 into lifi-refactor Jul 23, 2026
1 check passed
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