Assessment reports>Alkimiya>Threat Model>fillOrder

Function: fillOrder(SilicaOrder order, bytes signature, uint256 fraction)

This function is used to fill an order with the given parameters.

Inputs

  • order

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Order to fill.

  • signature

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Signature of the order.

  • fraction

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Value of the fraction.

Branches and code coverage

Intended branches

  • Transfers offeredUpfrontToken from the maker to the caller.

  • Transfers requestedUpfrontToken from the caller to the maker.

  • Collects surcharge from the caller.

  • Invokes _collateralizedMint for the long shares and the short shares for the maker and the caller.

  • Updates sFilledFraction for the order.

Negative behavior

  • Reverts if this function is called within a reentrant call.

  • Reverts if the order has already been filled.

  • Reverts if the order has been canceled.

  • Reverts if the signature is invalid.

  • Reverts if the caller is not matched with the taker or the order is not opened for all.

  • Reverts if the order has expired.

Function call analysis

  • ISilicaIndex(order.offeredLongSharesParams.index).decimals()

    • What is controllable? Address of order.offeredLongSharesParams.index.

    • If the return value is controllable, how is it used and how can it go wrong? Manipulating the return value can affect the state of the pool.

  • ISilicaIndex(order.requestedLongSharesParams.index).decimals()

    • What is controllable? Address of order.requestedLongSharesParams.index.

    • If the return value is controllable, how is it used and how can it go wrong? Manipulating the return value can affect the state of the pool.

Zellic © 2024Back to top ↑