onflow / onflow/FlowActions

Track remaining MultiSwapper quoteOut and SwapSource regressions

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cadence
Stars
9
Forks
3
Avg merge
1h 45m
Merged PRs (30d)
2

Description

Summary

Track the two remaining MultiSwapper regressions introduced by #158 that are intentionally not fixed in #167.

Remaining Regressions

  1. swap(nil, ...) / swapBack(nil, ...) can become inconsistent with quoteOut(...).

    Example:

    • caller provides 10 TokenA
    • selected inner capped route reports quoteOut(10) = { inAmount: 4, outAmount: 4 }
    • MultiSwapper._swap(...) still falls back to quoteOut(from.balance) and forwards the full 10 TokenA vault to the selected inner swapper
    • strict inner swappers can reject the call because execution forwarded more input than quote.inAmount
  2. SwapSource.withdrawAvailable(maxAmount) can return more than maxAmount.

    Example:

    • caller asks for withdrawAvailable(maxAmount: 10)
    • selected route returns quoteIn(10) = { inAmount: 10, outAmount: 11 }
    • SwapSource forwards that quote into swap(...)
    • caller receives more than the requested maximum amount

Notes

  • #167 intentionally fixes only the partial-route quoteIn(...) tie-break regression.
  • This follow-up issue keeps the larger quoteOut/execution-contract discussion and the SwapSource max-amount behavior together in one place.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the MultiSwapper regressions described here with issues #158 and #167, then trace the swap(nil, ...), swapBack(nil, ...), quoteOut(...), and SwapSource.withdrawAvailable(maxAmount) paths. Reproduce both examples and define completion as execution matching the quote and withdrawAvailable never returning more than maxAmount.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.