KryptoniteDAO / krp-cdp-contracts

Kryptonite stable coin kUSD relevant contracts
0 stars 0 forks source link

Miscalculation of max loan to value when minting coins #3

Closed smithmonnnnnnn closed 11 months ago

smithmonnnnnnn commented 11 months ago

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