This repository has been archived by the owner on Sep 24, 2023. It is now read-only.
IllIllI - EmptyFeedPrice
will cause orders to be canceled
#175
Labels
IllIllI
medium
EmptyFeedPrice
will cause orders to be canceledSummary
In most cases where orders are submitted using invalid oracle prices, the check for
isEmptyPriceError()
returns true, and the order execution is allowed to revert, rather than canceling the order.Vulnerability Detail
EmptyFeedPrice
isn't counted as one of these errors, and so if the price reaches zero, any outstanding order will be canceled.Impact
Orders to close positions will be canceled, leading to losses.
Code Snippet
Only
isEmptyPriceError()
errors are allowed to revert:https://github.com/sherlock-audit/2023-02-gmx/blob/main/gmx-synthetics/contracts/exchange/OrderHandler.sol#L226-L237
Other orders get frozen or canceled
Tool used
Manual Review
Recommendation
Include
EmptyFeedPrice
in the list ofOracleUtils.isEmptyPriceError()
errorsThe text was updated successfully, but these errors were encountered: