merge incoming change

This commit is contained in:
Mubaris NK 2021-04-15 21:47:46 +05:30
commit f4c7610b1c
No known key found for this signature in database
GPG Key ID: 9AC09AD0F8D68561

View File

@ -85,16 +85,18 @@ abstract contract Helpers is DSMath, Stores, Variables {
stableBorrow[i] = _data.stableBorrowAmts[i] == uint(-1) ? stableDebt : _data.stableBorrowAmts[i]; // Failing here?? 'invalid-opcode'
variableBorrow[i] = _data.variableBorrowAmts[i] == uint(-1) ? variableDebt : _data.variableBorrowAmts[i];
console.log("stableBorrow", stableBorrow[i]);
console.log("variableBorrow", variableBorrow[i]);
// console.log("stableBorrow", stableBorrow[i]);
// console.log("variableBorrow", variableBorrow[i]);
totalBorrow[i] = add(stableBorrow[i], variableBorrow[i]);
console.log("totalBorrow", totalBorrow[i]);
// console.log("totalBorrow", totalBorrow[i]);
if (totalBorrow[i] > 0) {
IERC20(_token).safeApprove(address(aave), totalBorrow[i]);
}
aave.borrow(_token, totalBorrow[i], 2, 3288, address(this));
// console.log("approved", IERC20(_token).allowance(address(this), address(aave)));
aave.borrow(_token, totalBorrow[i], 2, 3288, address(this)); // Failing over here ///
console.log("balanceOf", IERC20(_token).balanceOf(address(this)));
}
}
@ -117,8 +119,12 @@ abstract contract Helpers is DSMath, Stores, Variables {
} else {
_finalAmt = supplyAmts[i];
}
require(aTokenContract.transferFrom(dsa, address(this), finalAmts[i]), "transfer-failed");
console.log("balanceOf inital this", aTokenContract.balanceOf(address(this)));
console.log("balanceOf inital dsa", aTokenContract.balanceOf(dsa));
console.log("_finalAmt", _finalAmt);
console.log("allownace", IERC20(_aToken).allowance(dsa, address(this)));
require(aTokenContract.transferFrom(dsa, address(this), _finalAmt), "_getAtokens: atokens transfer failed");
console.log("balanceOf final", aTokenContract.balanceOf(address(this)));
_finalAmt = wmul(_finalAmt, fee);
finalAmts[i] = _finalAmt;