Assessment reports>GTE>Threat Model>amend

Function: amend(address account, AmendArgs args)

This function amends an existing limit order for the specified account. It can be called by the account itself or an approved operator, and it handles matching and settling amended orders with the existing order book. It also notifies the CLOBManager for token settlement and applies fees.

Inputs

  • account

    • Control: Full control.

    • Constraints: Should be msg.sender itself or an approved operator for the account and the owner of the order.

    • Impact: The owner of the order being amended.

  • args

    • Control: Full control.

    • Constraints: args.limitOrderType can only be POST_ONLY.

    • Impact: Contains orderId, amountInBase, price, cancelTimestamp, side, limitOrderType, and settlement.

Branches and code coverage

Intended branches

  • If args.cancelTimestamp is less than the current block.timestamp, the order will be canceled successfully without a fee.

  • If args.amountInBase is less than the settings.minLimitOrderAmountInBase, the order will be canceled successfully without a fee.

  • The side of the order has been changed successfully.

  • The price of the order has been updated successfully.

Negative behavior

  • order.owner != account.

  • The caller is not an account or operator of the account.

  • price % tickSize != 0.

  • args.price == 0.

  • limitOrderType == LimitOrderType.GOOD_TILL_CANCELLED.

  • order.id does not exist.

Zellic © 2025Back to top ↑