Assessment reports>Orderly Network>Threat Model>futuresTradeUpload

Function: futuresTradeUpload(PerpTypes.FuturesTradeUploadData data)

This uploads a perpetual futures trade. For more information, see the description of the Ledger.executeProcessValidatedFutures function.

Inputs

  • data

    • Control: Controlled by operator.

    • Constraints: Verify that data is signed by cefiPerpTradeUploadAddress. The data.batchId should be equal to futuresUploadBatchId.

    • Impact: The data to upload.

Branches and code coverage

Negative behavior

  • Caller is not a trusted operator.

  • Signature is wrong.

  • Resend the same message again after successful execution.

Function call analysis

  • _innerPing()

    • External/Internal? Internal.

    • Argument control? N/A.

    • Impact: Update the lastOperatorInteraction by current timestamp.

  • _futuresTradeUploadData -> _processValidatedFutures -> ledger.executeProcessValidatedFutures(trade)

    • External/Internal? External.

    • Argument control? trade.

    • Impact: Add new or update existing perpetual futures trade position of accountId in Ledger contract.

Zellic © 2024Back to top ↑