Skip to content
This repository has been archived by the owner on Nov 27, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (17 loc) · 918 Bytes

updating-cancelling-an-order.md

File metadata and controls

27 lines (17 loc) · 918 Bytes

Updating/Canceling an Order

Updating an Order

To update an order we need to make the changes and send a POST request to the API this can be found on the Creating A Sell Order page.

New Orders check the Start, End, taker, make and value. If any of these are invalid you will receive a 400 response code from the API.

{% hint style="danger" %} The price can only be lowered and not increased, to increase the price you will need to cancel the order and create a new one. {% endhint %}

Canceling an Order

Canceling an order needs to be done on-chain by calling the cancel method on the exchange contract.

function cancel(LibOrder.Order memory order) public {
 require(_msgSender() == order.maker, "not a maker");
 bytes32 orderKeyHash = LibOrder.hashKey(order);
 fills[orderKeyHash] = UINT256_MAX;
 emit Cancel(orderKeyHash);
}