mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
bugs resolved
This commit is contained in:
parent
2b06bcc8dd
commit
fffdf35a93
|
@ -433,10 +433,9 @@ contract GetDetails is MakerHelpers {
|
|||
colToFree = ethToSwap;
|
||||
}
|
||||
(uint expectedRate,) = getBest(getAddressETH(), getAddressDAI(), colToFree);
|
||||
uint expectedDAI = wmul(colToFree, expectedRate);
|
||||
if (expectedDAI < daiDebt) {
|
||||
if (expectedRate < daiDebt) {
|
||||
finalEthCol = sub(ethCol, colToFree);
|
||||
finalDaiDebt = sub(daiDebt, expectedDAI);
|
||||
finalDaiDebt = sub(daiDebt, expectedRate);
|
||||
finalColToUSD = wmul(finalEthCol, usdPerEth);
|
||||
canSave = true;
|
||||
} else {
|
||||
|
@ -467,9 +466,8 @@ contract GetDetails is MakerHelpers {
|
|||
debtToBorrow = daiToSwap;
|
||||
}
|
||||
(uint expectedRate,) = getBest(getAddressDAI(), getAddressETH(), debtToBorrow);
|
||||
uint expectedETH = wmul(debtToBorrow, expectedRate);
|
||||
if (ethCol != 0) {
|
||||
finalEthCol = add(ethCol, expectedETH);
|
||||
finalEthCol = add(ethCol, expectedRate);
|
||||
finalDaiDebt = add(daiDebt, debtToBorrow);
|
||||
finalColToUSD = wmul(finalEthCol, usdPerEth);
|
||||
canLeverage = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user