Description:
In the mint_stable_coin function from central_pool contract, the max loan to value is miscalculated because the collaterals_values is increased in every step of the loop instead of storing the temporal value, i.e.: collaterals_values = Uint256::from(collateral.1) * price.emv_price. As a consequence, users can borrow more coins than the they should.
Code Location:
krp-cdp-contracts/contracts/central_control/src/contract.rs#L575
Description: In the
mint_stable_coin
function from central_pool contract, the max loan to value is miscalculated because thecollaterals_values
is increased in every step of the loop instead of storing the temporal value, i.e.: collaterals_values = Uint256::from(collateral.1) * price.emv_price. As a consequence, users can borrow more coins than the they should. Code Location: krp-cdp-contracts/contracts/central_control/src/contract.rs#L575