From f461634c8da73c05265c1b488b084ffe169ae1f2 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Wed, 31 Mar 2021 18:24:03 +0530 Subject: [PATCH] Update --- contracts/protocols/maker.sol | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/contracts/protocols/maker.sol b/contracts/protocols/maker.sol index bc35da6..34a952e 100644 --- a/contracts/protocols/maker.sol +++ b/contracts/protocols/maker.sol @@ -166,16 +166,13 @@ contract Helpers is DSMath { (, ratio) = SpotLike(spot).ilks(ilk); } - function getDebtCeiling(bytes32 ilk) internal view returns (uint debtCeiling, uint totalDebt) { + function getDebtFloorAndCeiling(bytes32 ilk) internal view returns (uint, uint, uint) { address vat = InstaMcdAddress(getMcdAddresses()).vat(); - (uint totalArt,uint rate,,uint debtCeilingRad,) = VatLike(vat).ilks(ilk); + (uint totalArt,uint rate,, uint debtCeilingRad, uint debtFloor) = VatLike(vat).ilks(ilk); debtCeiling = debtCeilingRad / 10 ** 45; totalDebt = rmul(totalArt, rate); - } - function getDebtFloor(bytes32 ilk) internal view returns(uint debtFloor) { - address vat = InstaMcdAddress(getMcdAddresses()).vat(); - (,,,,debtFloor) = VatLike(vat).ilks(ilk); + return (debtCeiling, totalDebt, debtFloor); } } @@ -242,13 +239,13 @@ contract VaultResolver is Helpers { for (uint i = 0; i < name.length; i++) { bytes32 ilk = stringToBytes32(name[i]); - (uint debtCeiling, uint totalDebt) = getDebtCeiling(ilk); + (uint debtCeiling, uint totalDebt, uint debtFloor) = getDebtFloorAndCeiling(ilk); colInfo[i] = ColInfo( getFee(ilk), getColPrice(ilk), getColRatio(ilk), debtCeiling, - getDebtFloor(ilk), + debtFloor, totalDebt ); }