This repository has been archived by the owner on Dec 10, 2023. It is now read-only.
stent - Negative prices will cause old orders to be canceled (same as previous audit) #209
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
stent
medium
Negative prices will cause old orders to be canceled (same as previous audit)
Summary
This was an issue from the previous Sherlock audit: sherlock-audit/2023-02-gmx-judging#177
In the above issue it was stated "Although unlikely the possibility of this must be addressed instead of canceling it" which is not case in the new code. A new error was added and thrown correctly as suggested, but not caught in the
_handleOrderError
function and so the order is still cancelled.Vulnerability Detail
Same as previous audit.
Impact
Same as previous audit.
Code Snippet
Negative price causes custom error revert:
https://github.com/gmx-io/gmx-synthetics/blob/a2e331f6d0a3b59aaac5ead975b206840369a723/contracts/oracle/Oracle.sol#L604
Tool used
Manual Review
Recommendation
Add new error to the list of oracle errors in
_handleOrderError
that result in the tx being reverted withErrorUtils.revertWithCustomError
The text was updated successfully, but these errors were encountered: