mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
fixed cdp to vault oasis bug
This commit is contained in:
parent
97bbe7b6dd
commit
759a19e665
|
@ -270,11 +270,12 @@ contract LiquidityResolver is Helpers {
|
||||||
contract MKRSwapper is LiquidityResolver {
|
contract MKRSwapper is LiquidityResolver {
|
||||||
|
|
||||||
function getBestMkrSwap(address srcTknAddr, uint destMkrAmt) public view returns(uint bestEx, uint srcAmt) {
|
function getBestMkrSwap(address srcTknAddr, uint destMkrAmt) public view returns(uint bestEx, uint srcAmt) {
|
||||||
uint oasisPrice = getOasisSwap(srcTknAddr, destMkrAmt);
|
// uint oasisPrice = getOasisSwap(srcTknAddr, destMkrAmt);
|
||||||
uint uniswapPrice = getUniswapSwap(srcTknAddr, destMkrAmt);
|
uint uniswapPrice = getUniswapSwap(srcTknAddr, destMkrAmt);
|
||||||
require(oasisPrice != 0 && uniswapPrice != 0, "swap price 0");
|
// require(oasisPrice != 0 && uniswapPrice != 0, "swap price 0");
|
||||||
srcAmt = oasisPrice < uniswapPrice ? oasisPrice : uniswapPrice;
|
// srcAmt = oasisPrice < uniswapPrice ? oasisPrice : uniswapPrice;
|
||||||
bestEx = oasisPrice < uniswapPrice ? 0 : 1; // if 0 then use Oasis for Swap, if 1 then use Uniswap
|
srcAmt = uniswapPrice;
|
||||||
|
bestEx = 1; // if 0 then use Oasis for Swap, if 1 then use Uniswap
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOasisSwap(address tokenAddr, uint destMkrAmt) public view returns(uint srcAmt) {
|
function getOasisSwap(address tokenAddr, uint destMkrAmt) public view returns(uint srcAmt) {
|
||||||
|
@ -511,7 +512,7 @@ contract MigrateHelper is MCDResolver {
|
||||||
maxConvert = sub(wdiv(saiBal, _wadTotal), 100);
|
maxConvert = sub(wdiv(saiBal, _wadTotal), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
require(_wad > 20*10**18, "Min 20 Dai required to migrate."); // Check Thrilok - is the 20dai value correct?
|
require(_wad >= 20*10**18, "Min 20 Dai required to migrate."); // Check Thrilok - is the 20dai value correct?
|
||||||
// ink according to maxConvert ratio.
|
// ink according to maxConvert ratio.
|
||||||
_ink = wmul(tub.ink(cup), maxConvert);
|
_ink = wmul(tub.ink(cup), maxConvert);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user