Flash ethAmt update

This commit is contained in:
Samyak Jain 2021-04-14 04:00:38 +05:30
parent e3ef78e689
commit 0d0770ecc7

View File

@ -191,10 +191,6 @@ contract MigrateResolver is LiquidityResolver {
"invalid-length"
);
if (ethAmt > 0) {
aave.deposit(wethAddr, ethAmt, address(this), 3288);
}
(uint[] memory stableBorrows, uint[] memory variableBorrows, uint[] memory totalBorrows) = _PaybackCalculate(aave, _data, sourceDsa);
_PaybackStable(_data.borrowTokens.length, aave, _data.borrowTokens, stableBorrows, sourceDsa);
@ -215,10 +211,6 @@ contract MigrateResolver is LiquidityResolver {
// Checks the amount that user is trying to migrate is 20% below the Liquidation
_checkRatio(data);
if (ethAmt > 0) {
aave.withdraw(wethAddr, ethAmt, address(this));
}
isPositionSafe();
stateSender.syncState(polygonReceiver, abi.encode(data));
@ -245,7 +237,9 @@ contract MigrateResolver is LiquidityResolver {
TokenInterface wethContract = TokenInterface(wethAddr);
wethContract.approve(address(aave), ethAmt);
aave.deposit(wethAddr, ethAmt, address(this), 3288);
_migrate(aave, _data, dsa, ethAmt);
aave.withdraw(wethAddr, ethAmt, address(this));
wethContract.transfer(address(flashloanContract), ethAmt);
}