Assessment reports>Y2K Finance>Threat Model>_swapWithCurve

Function: _swapWithCurve(byte[] payload)

This decodes the payload and routes to _swap, _swapEth, or _multiSwap depending on swapType.

Inputs

  • payload

    • Constraints: Should decode to the correct format.

    • Impact: The data to decode and pass to the correct function.

Branches and code coverage (including function calls)

Intended branches

  • If swapType is 0x01, 0x02, or 0x03, use the correct swap method.

Negative behavior

  • Revert if amountOut == 0.

  • Revert if swapType is not one of 0x01, 0x02 or 0x03.

Zellic © 2024Back to top ↑