SoftVault accrued interest is not refunded and stuck forever
Summary
Withdrawing isolated collateral tokens does not refund the accrued interest from Blueberry's lending market and remains stuck forever in the BlueBerryBank contract.
Vulnerability Detail
Isolated collateral is lent out to Blueberry's lending market (a Compound fork) via the SoftVault contract. These deposits accrue interest over time.
When a user withdraws isolated collateral using the BlueBerryBank.withdrawLend function within a spell, the withdrawn amount (wAmount) is capped at the initially deposited amount (pos.underlyingAmount).
Thus, if the withdrawn amount wAmount is greater than pos.underlyingAmount, the delta, which is the accrued interest, remains in the BlueBerryBank contract and is not refunded to the user.
Impact
Accrued cToken interest is unrecoverable and stuck forever in the BlueBerryBank contract.
berndartmueller
high
SoftVault
accrued interest is not refunded and stuck foreverSummary
Withdrawing isolated collateral tokens does not refund the accrued interest from Blueberry's lending market and remains stuck forever in the
BlueBerryBank
contract.Vulnerability Detail
Isolated collateral is lent out to Blueberry's lending market (a Compound fork) via the
SoftVault
contract. These deposits accrue interest over time.When a user withdraws isolated collateral using the
BlueBerryBank.withdrawLend
function within a spell, the withdrawn amount (wAmount
) is capped at the initially deposited amount (pos.underlyingAmount
).Thus, if the withdrawn amount
wAmount
is greater thanpos.underlyingAmount
, the delta, which is the accrued interest, remains in theBlueBerryBank
contract and is not refunded to the user.Impact
Accrued cToken interest is unrecoverable and stuck forever in the
BlueBerryBank
contract.Code Snippet
BlueBerryBank.sol#L693-L695
Tool used
Manual Review
Recommendation
Consider either keeping the accrued cToken interest as part of protocol revenue or refunding it to the user.
Duplicate of #109