From 5ebb99aa8e538ee802f6e1bafe14f5fd56647c38 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Wed, 31 Mar 2021 18:09:58 +0530 Subject: [PATCH] Add debt floor --- contracts/protocols/maker.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/protocols/maker.sol b/contracts/protocols/maker.sol index 9d08e59..6f34615 100644 --- a/contracts/protocols/maker.sol +++ b/contracts/protocols/maker.sol @@ -111,6 +111,7 @@ contract Helpers is DSMath { uint price; uint liquidationRatio; uint debtCelling; + uint debtFloor; uint totalDebt; } @@ -171,6 +172,11 @@ contract Helpers is DSMath { 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); + } } @@ -242,6 +248,7 @@ contract VaultResolver is Helpers { getColPrice(ilk), getColRatio(ilk), debtCeiling, + getDebtFloor(ilk), totalDebt ); }