Closed detectivekim closed 1 year ago
minDebtAmount = (
debtDecimal > 18
? (minDebtValueInEth * prices[2]) * 10 ** (debtDecimal - 18)
: (minDebtValueInEth * prices[2]) / 10 ** (18 - debtDecimal)
) / prices[1];
Fixed at #69.
Description
Due to the following code, debtDecimal must always be 18 or less. Therefore, within the setLoanConfiguration function, it is necessary to check if the decimal of the debtToken is 18 or lower.
https://github.com/clober-dex/coupon-finance/blob/6e917ad8f21b9b7c25469589dd733e1c1d92c87a/contracts/LoanPositionManager.sol#L163-L164
https://github.com/clober-dex/coupon-finance/blob/6e917ad8f21b9b7c25469589dd733e1c1d92c87a/contracts/LoanPositionManager.sol#L318-L339