mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
bug fixed in mcd migrate
This commit is contained in:
parent
b0d180361c
commit
65641f2c37
|
@ -181,7 +181,7 @@ contract Helpers is DSMath {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev get Compound ETH Address
|
* @dev get ETH Address
|
||||||
*/
|
*/
|
||||||
function getETHAddress() public pure returns (address ethAddr) {
|
function getETHAddress() public pure returns (address ethAddr) {
|
||||||
ethAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // main
|
ethAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // main
|
||||||
|
@ -328,19 +328,21 @@ contract MKRSwapper is LiquidityResolver {
|
||||||
|
|
||||||
if (tokenAddr == getETHAddress()) {
|
if (tokenAddr == getETHAddress()) {
|
||||||
mkrEx.ethToTokenSwapOutput.value(srcAmt)(govFee, uint(1899063809));
|
mkrEx.ethToTokenSwapOutput.value(srcAmt)(govFee, uint(1899063809));
|
||||||
} else if (tokenAddr != getSaiAddress() && tokenAddr != getDaiAddress()) {
|
} else {
|
||||||
require(TokenInterface(tokenAddr).transferFrom(msg.sender, address(this), srcAmt), "not-approved-yet");
|
if (tokenAddr != getSaiAddress() && tokenAddr != getDaiAddress()) {
|
||||||
|
require(TokenInterface(tokenAddr).transferFrom(msg.sender, address(this), srcAmt), "not-approved-yet");
|
||||||
|
}
|
||||||
|
address buyTknExAddr = UniswapFactoryInterface(getUniFactoryAddr()).getExchange(tokenAddr);
|
||||||
|
UniswapExchange buyTknEx = UniswapExchange(buyTknExAddr);
|
||||||
|
setApproval(tokenAddr, srcAmt, buyTknExAddr);
|
||||||
|
buyTknEx.tokenToTokenSwapOutput(
|
||||||
|
govFee,
|
||||||
|
srcAmt,
|
||||||
|
uint(999000000000000000000),
|
||||||
|
uint(1899063809), // 6th March 2030 GMT // no logic
|
||||||
|
mkr
|
||||||
|
);
|
||||||
}
|
}
|
||||||
address buyTknExAddr = UniswapFactoryInterface(getUniFactoryAddr()).getExchange(tokenAddr);
|
|
||||||
UniswapExchange buyTknEx = UniswapExchange(buyTknExAddr);
|
|
||||||
setApproval(tokenAddr, srcAmt, buyTknExAddr);
|
|
||||||
buyTknEx.tokenToTokenSwapOutput(
|
|
||||||
govFee,
|
|
||||||
srcAmt,
|
|
||||||
uint(999000000000000000000),
|
|
||||||
uint(1899063809), // 6th March 2030 GMT // no logic
|
|
||||||
mkr
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user