Function: updateOpenLimitOrder(uint256 _pairIndex, uint256 _index, uint256 _price, uint256 _tp, uint256 _sl)
This updates an open limit order.
Inputs
_pairIndexControl: Fully controlled by the caller.
Constraints: None.
Impact: The index of the trading pair.
_indexControl: Fully controlled by the caller.
Constraints: None.
Impact: The index of the order.
_priceControl: Fully controlled by the caller.
Constraints: None.
Impact: The price level to set (
_PRECISION).
_tpControl: Fully controlled by the caller.
Constraints: None.
Impact: The take-profit price.
_slControl: Fully controlled by the caller.
Constraints: None.
Impact: The stop-loss price.
Branches and code coverage
Intended branches
If the new TP and SL are in the correct range, update the open limit order.
Negative behavior
Revert if the time since the order creation is less than the defined timelock period. (Enforces timelock for order updates.)
Revert if
_tpis set and not valid according to order type.Revert if
_slis set and not valid according to order type.
Function call analysis
this.storageT.getOpenLimitOrder(msg.sender, _pairIndex, _index)What is controllable?
msg.sender,_pairIndex, and_index.If the return value is controllable, how is it used and how can it go wrong? Returns the open limit order; this limit order is updated and later stored in storage.
What happens if it reverts, reenters, or does other unusual control flow? N/A.
this.storageT.updateOpenLimitOrder(o)What is controllable?
o.If the return value is controllable, how is it used and how can it go wrong? Updates the open limit order based on the provided information — no return value.
What happens if it reverts, reenters, or does other unusual control flow? If it reverts, the entire call will revert — no reentrancy scenarios.