The transaction will fail if the transfer of collateral is not already approved
Summary
The contract doesn't explicitly check if the borrower has approved the transfer. If the borrower hasn't approved, the transaction will revert, but it will do so after consuming gas for all prior operations.
The borrower must have sufficient collateral and have approved the transfer before calling this function. This might be challenging for some users who prefer to separate approval and transfer actions.
Melodic Mocha Aardvark
Low/Info
The transaction will fail if the transfer of collateral is not already approved
Summary
The contract doesn't explicitly check if the borrower has approved the transfer. If the borrower hasn't approved, the transaction will revert, but it will do so after consuming gas for all prior operations.
The borrower must have sufficient collateral and have approved the transfer before calling this function. This might be challenging for some users who prefer to separate approval and transfer actions.
Root Cause
https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L991
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
PoC
No response
Mitigation
No response