From d5b06da0f12e9fb755fdfbb9dde0d8cfdad08fac Mon Sep 17 00:00:00 2001 From: Samyak Jain <34437877+KaymasJain@users.noreply.github.com> Date: Sat, 11 Apr 2020 06:13:49 +1000 Subject: [PATCH] bug fix in maker resolver --- protocols/maker.sol | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/protocols/maker.sol b/protocols/maker.sol index 9c41b3c..78b782a 100644 --- a/protocols/maker.sol +++ b/protocols/maker.sol @@ -106,7 +106,7 @@ contract Helpers is DSMath { address vaultAddress; } - struct IlkData { + struct ColInfo { uint borrowRate; uint price; uint liquidationRatio; @@ -222,18 +222,18 @@ contract VaultResolver is Helpers { return vault; } - function getColInfo(string memory name) public view returns (IlkData[] memory) { - bytes32 ilks = stringToBytes32(name); - IlkData[] memory ilkData = new IlkData[](ilks.length); + function getColInfo(string[] memory name) public view returns (ColInfo[] memory) { + ColInfo[] memory colInfo = new ColInfo[](name.length); - for (uint i = 0; i < ilks.length; i++) { - ilkData[i] = IlkData( - getFee(ilks[i]), - getColPrice(ilks[i]), - getColRatio(ilks[i]) + for (uint i = 0; i < name.length; i++) { + bytes32 ilk = stringToBytes32(name[i]); + colInfo[i] = ColInfo( + getFee(ilk), + getColPrice(ilk), + getColRatio(ilk) ); } - return ilkData; + return colInfo; } }