0xGoodess
medium
there is no way to set a collateral-free loan to LIQUIDATED without preparation of additional fund
as Teller permits a collateral-free loan; * @notice Function for a borrower to create a bid for a loan without Collateral.
;
when such a bid is accepted, this loan would have 2 things different then a collateral-backed loan:
isBidCollateralBacked
check to return false- No escow Proxy deployed.
Now, if the borrower default his payment, the lender would have no choice but express this behavior on the state of this bid. There are only two entry points for the lender:
-
CollateralManager::withdraw
, which does nothing since there is no collateral; -
TellerV2::liquidateLoanFull
; however, the lender then would have to, with very sub-optimal UX, to prepare additional fund(see below snippet) in order to execute this self-transfer.
// @> audit lender himself has to have additional fund in order to pass this self-transfer.
// Send payment to the lender
bid.loanDetails.lendingToken.safeTransferFrom(
_msgSenderForMarket(bid.marketplaceId),
lender,
paymentAmount
);
no way for the lender to express the breaking of agreement unless he/shre prepares an equal amount of borrowed fund.
Manual Review
short-circuit the bid to LIQUDIATED in liquidateCollateral
if the bid is a collateral-free loan
function liquidateLoanFull(uint256 _bidId)
external
acceptedLoan(_bidId, "liquidateLoan")
{
require(isLoanLiquidateable(_bidId), "Loan must be liquidateable.");
+++ if(!CollateralManager.isBidCollateralBacked(_bidId), "bid is collateral-backed") {
+++ bid.state = BidState.LIQUIDATED;
+++ return;
+++ } ....
}