mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
Fixed allowance issue while paying back flashloan
This commit is contained in:
parent
ad58a84dd7
commit
168479f90b
|
@ -3,7 +3,7 @@ pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
interface TokenInterface {
|
interface TokenInterface {
|
||||||
function approve(address, uint256) external;
|
function approve(address, uint256) external;
|
||||||
function transfer(address, uint) external;
|
function transfer(address, uint) external returns (bool);
|
||||||
function transferFrom(address, address, uint) external;
|
function transferFrom(address, address, uint) external;
|
||||||
function deposit() external payable;
|
function deposit() external payable;
|
||||||
function withdraw(uint) external;
|
function withdraw(uint) external;
|
||||||
|
|
|
@ -304,6 +304,8 @@ contract DydxFlashloaner is Setup, ICallee, DydxFlashloanBase, DSMath {
|
||||||
Account.Info[] memory accountInfos = new Account.Info[](1);
|
Account.Info[] memory accountInfos = new Account.Info[](1);
|
||||||
accountInfos[0] = _getAccountInfo();
|
accountInfos[0] = _getAccountInfo();
|
||||||
|
|
||||||
|
wethContract.approve(soloAddr, ethAmt + 2);
|
||||||
|
|
||||||
solo.operate(accountInfos, operations);
|
solo.operate(accountInfos, operations);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,8 +187,8 @@ contract MigrateResolver is LiquidityResolver {
|
||||||
_migrate(aave, _data, dsa);
|
_migrate(aave, _data, dsa);
|
||||||
console.log("here3");
|
console.log("here3");
|
||||||
aave.withdraw(wethAddr, ethAmt, address(this));
|
aave.withdraw(wethAddr, ethAmt, address(this));
|
||||||
console.log("here4");
|
console.log("here4", ethAmt);
|
||||||
wethContract.transfer(address(flashloanContract), ethAmt);
|
require(wethContract.transfer(address(flashloanContract), ethAmt), "migrateFlashCallback: weth transfer failed to Instapool");
|
||||||
console.log("here5");
|
console.log("here5");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user