Assessment reports>Tradoor>Threat Model>Message: CancelLiquidityOrder

Message: CancelLiquidityOrder

This message allows the owner of an order or an executor to cancel a liquidity order that is inserted but not pending.

The message must have at least self.cancelLiquidityOrderGas + self.transferJettonGas TON to cover for the gas fees required to cancel the order. The order must exist and must not be in a pending state.

An executor can cancel the order at any time, while the order owner can only cancel the order after it has been pending for at least the orderLockTime configured for the pool. The order is deleted from the contract storage, and the collateral associated with the order is returned to the order owner.

The execution fees paid for the order are also returned. The recipient of the execution fees can be optionally specified in the incoming message. If unspecified, the execution fees will be sent to the message sender. Finally, an event signals the order cancellation is emitted, and the excess TON is refunded to the message sender.

Inputs

The incoming message has the following structure:

message CancelLiquidityOrder { orderId: Int as uint64; trxId: Int as uint64; executionFeeReceiver: Address?; }
  • orderId

    • Validation: Must be an existing pending order owned by the sender (unless the sender is an executor). Other checks are performed on the order (see earlier section).

    • Impact: Identifies the order to be canceled.

  • trxId

    • Validation: None.

    • Impact: Request ID to be used for the jetton transfer refunding the order-execution fees. Not involved in the contract logic.

  • executionFeeReceiver

    • Validation: None.

    • Impact: Optional address that will receive the execution-fees refund. If unspecified, defaults to the sender of the message.

Test coverage

Intended branches

Negative behavior

Zellic © 2025Back to top ↑