Closed github-actions[bot] closed 1 year ago
@clems4ev3r We think this will be mitigated by daily premium accrual. We are planning to do the following fix in an upcoming version: Once the lending pool is expired/repaid, all premiums from that pool should accrue right away.
@vnadoda, agreed this is a valid issue, not sure about medium impact since it's only a delay of rewards
@clems4ev3r this should be low priority issue, which we will fix in upcoming version. @hrishibhat can we close this?
Agreed, considering this issue as low
rvierdiiev
medium
Repaid lending pool should distribute premium to protection sellers
Summary
Repaid lending pool should distribute premium to protection sellers
Vulnerability Detail
Lending pool can become expired which can mean that
_creditLine.termEndTime()
has passed or_creditLine.balance() == 0
which means that lending pool debt is repaid. https://github.com/sherlock-audit/2023-02-carapace/blob/main/contracts/adapters/GoldfinchAdapter.sol#L62-L77In case if pool is expired that means that protection has finished for protection buyers of that lending pool. It's possible that borrower will repay lending pool earlier than end timestamp, in this case premium for that lending pool should be distributed to the protection sellers. Currently nothing will happen and protection sellers will wait until end of each protection for that lending pool.
Impact
Protection sellers do not receive payment for protection, once protection is over.
Code Snippet
https://github.com/sherlock-audit/2023-02-carapace/blob/main/contracts/adapters/GoldfinchAdapter.sol#L62-L77 https://github.com/sherlock-audit/2023-02-carapace/blob/main/contracts/core/DefaultStateManager.sol#L365-L370 https://github.com/sherlock-audit/2023-02-carapace/blob/main/contracts/core/pool/ProtectionPool.sol#L279-L354
Tool used
Manual Review
Recommendation
Once lending pool is repaid, then pay all remaining premium to the protection sellers.