You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
sherlock-admin opened this issue
Jul 3, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Solvency is not being checked correctly on opening position
Summary
I think an open position might be liquidated right after opening due to an incorrect solvency check
Vulnerability Detail
Whevener partyA opens a position there is a call to openPosition. There is a check for solvency LibSolvency.isSolventAfterOpenPosition(quoteId, filledAmount, upnlSig)
lockedValues there is not the same as what is actually being added to locked values after the solvency check, follow the code that is being added to lockedBalances. Please look at the recommendation to see what I mean as well
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
volodya
high
Solvency is not being checked correctly on opening position
Summary
I think an open position might be liquidated right after opening due to an incorrect solvency check
Vulnerability Detail
Whevener partyA opens a position there is a call to
openPosition
. There is a check for solvencyLibSolvency.isSolventAfterOpenPosition(quoteId, filledAmount, upnlSig)
lockedValues there is not the same as what is actually being added to locked values after the solvency check, follow the code that is being added to
lockedBalances
. Please look at the recommendation to see what I mean as well/symmio-core/contracts/libraries/LibSolvency.sol#L33
Tracking
lockedBalances
facets/PartyB/PartyBFacetImpl.sol#L159
Impact
A position might be liquidated after creation or a position will not be opened when it should
Code Snippet
Tool used
Manual Review
Recommendation
I've followed the computation after the solvency check for
lockedBalances
, here is how I think it should beDuplicate of #225
The text was updated successfully, but these errors were encountered: