It means it requires some Period that ensures both parties agree on the final state before closing.
On PartyAFacetImpl#forceClosePosition(),
maLayout.forceCloseMinSigPeriod (the minimum signature period required for force closing of positions) is checked only when closePrice is equal to sig.averagePrice.
It means the minimum signature period might be not elapsed when closePrice is different thansig.averagePrice.
unix515
Medium
Force Close Minimum Signature Period
might be skipped whenclosePrice
is different thansig.averagePrice
.Summary
force close minimum signature period
to ensure both parties agree on the final state before closing.closePrice
is equal tosig.averagePrice
.closePrice
is different thansig.averagePrice
.Vulnerability Detail
For about PartyA's forceClosePosition,
Period
that ensures both parties agree on the final state before closing.On PartyAFacetImpl#
forceClosePosition()
,maLayout.forceCloseMinSigPeriod
(the minimum signature period required for force closing of positions) is checked only whenclosePrice
is equal tosig.averagePrice
.closePrice
is different thansig.averagePrice
.forceCloseMinSigPeriod
,closePrice
is determined.Impact
Force Close Minimum Signature Period
might be not elapsed whenclosePrice
is different thansig.averagePrice
and It happens protocol violation.Code Snippet
https://github.com/sherlock-audit/2024-06-symmetrical-update-2/blob/main/protocol-core/contracts/facets/PartyA/PartyAFacetImpl.sol#L243
Tool used
Manual Review
Recommendation
Please update PartyAFacetImpl#
forceClosePosition()
as follows.