sherlock-audit / 2024-09-predict-fun-judging

0 stars 0 forks source link

Melodic Mocha Aardvark - Insufficient Collateralization Ratio Check Leading to Potential Undercollateralized Loans #320

Open sherlock-admin2 opened 2 days ago

sherlock-admin2 commented 2 days ago

Melodic Mocha Aardvark

High

Insufficient Collateralization Ratio Check Leading to Potential Undercollateralized Loans

Summary

_assertCollateralizationRatioAtLeastOneHundredPercent function, only ensures that the collateral amount is not less than the loan amount

function _assertCollateralizationRatioAtLeastOneHundredPercent(
    uint256 collateralAmount,
    uint256 loanAmount
) private pure {
    if (collateralAmount < loanAmount) {
        revert CollateralizationRatioTooLow();
    }
}

it is used in functions including matchProposals, _acceptOffer, and _refinance. though it prevents loans from being created with less collateral than the loan amount, but it allows for exactly 1:1 collateralization.

The issue now is :

Root Cause

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L1234

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

PoC

No response

Mitigation