Closed sherlock-admin2 closed 5 months ago
Request PoC
PoC requested from @ydspa
Requests remaining: 8
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid
Since the watson did not reply with a valid PoC, I cannot verify its validity
KingNFT
medium
Unfair distribution while
stableCollateralTotal
can not cover all traders' profitSummary
In the situation that
stableCollateralTotal
can't cover all traders' profit, traders who close their positions early can get 100% profit, traders who close lately can get less profit, or in the worst case get nothing. This is not a fair distribution design.Vulnerability Detail
Let's say current
stableCollateralTotal = 10rETH
, and all traders' profit are likeIf Alice and Bob close their position early than Carl, they get all 10ETH. While Carl tries to close his position, there is no penny left. A fair distribution should look like
Impact
In this case, part of users would get far less profit than fair distribution.
Code Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/bba4f077a64f43fbd565f8983388d0e985cb85db/flatcoin-v1/src/LeverageModule.sol#L255
Tool used
Manual Review
Recommendation
see PoC