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
fffdf35a93
commit
dd62faa009
|
@ -498,7 +498,9 @@ contract SaveResolver is GetDetails {
|
||||||
function saveSwap(uint srcAmt, uint daiDebt) internal returns (uint destAmt) {
|
function saveSwap(uint srcAmt, uint daiDebt) internal returns (uint destAmt) {
|
||||||
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
|
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
|
||||||
if (isBest == 0) {
|
if (isBest == 0) {
|
||||||
TokenInterface(getAddressWETH()).deposit.value(srcAmt)();
|
TokenInterface weth = TokenInterface(getAddressWETH());
|
||||||
|
weth.deposit.value(srcAmt)();
|
||||||
|
setAllowance(weth, getAddressEth2Dai());
|
||||||
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
|
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
|
||||||
getAddressWETH(),
|
getAddressWETH(),
|
||||||
srcAmt,
|
srcAmt,
|
||||||
|
@ -528,6 +530,7 @@ contract SaveResolver is GetDetails {
|
||||||
function loopSwap(uint srcAmt) internal returns (uint destAmt) {
|
function loopSwap(uint srcAmt) internal returns (uint destAmt) {
|
||||||
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
|
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
|
||||||
if (isBest == 0) {
|
if (isBest == 0) {
|
||||||
|
setAllowance(TokenInterface(getAddressDAI()), getAddressEth2Dai());
|
||||||
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
|
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
|
||||||
getAddressDAI(),
|
getAddressDAI(),
|
||||||
srcAmt,
|
srcAmt,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user