Closed c4-bot-1 closed 6 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as primary issue
Similar as in #131 with differing scenario.
ditto-eth (sponsor) disputed
This is intentional to prevent gaining yield from flash loans
hansfriese marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/ShortRecordFacet.sol#L40-L70
Vulnerability details
Impact
Shorter will lose so far gained yield if chooses to increase the collateral of his position. ShortRecord.updatedAt and ShortRecord.dethYieldRate are updated but the yield is not given to the user.
Proof of Concept
You can place the following 2 tests at the bottom of the file in BidOrders.t.sol.
Example of a flow with increased collateral and the lost yield:
Example of a flow without increased collateral and gained yield:
Tools Used
Manual Review
Recommended Mitigation Steps
Give the yield to the user in the increase collateral function.
Assessed type
Other