Assessment reports>Y2K Finance>Threat Model>_multiSwap

Function: _multiSwap(address[] path, address[] pools, uint256[] iValues, uint256[] jValues, uint256 fromAmount, uint256 toAmountMin)

Delegates the swap logic for each swap/pair to _swapEth or _swap.

Inputs

  • path

    • Constraints: No constraints.

    • Impact: An array of the tokens being swapped between.

  • pools

    • Constraints: No constraints.

    • Impact: An array of Curve pools to swap with.

  • iValues

    • Constraints: No constraints.

    • Impact: An array of indexes of the fromToken in each Curve pool.

  • jValues

    • Constraints: No constraints.

    • Impact: An array of indexes of the toToken in each Curve pool.

  • fromAmount

    • Constraints: No constraints.

    • Impact: The amount of fromToken to swap.

  • toAmountMin

    • Constraints: No constraints.

    • Impact: The minimum amount of toToken to receive from the swap.

Branches and code coverage (including function calls)

Intended branches

  • If any of the path is address(0), use _swapEth for swapping tokens; otherwise, use _swap.

Negative behavior

  • Revert if amountOut == 0.

Zellic © 2024Back to top ↑