Minor change

This commit is contained in:
Thrilok Kumar 2021-01-12 18:26:56 +05:30
parent cd84e7157d
commit 9a0b2fff32

View File

@ -891,7 +891,9 @@ contract AaveV2Helpers is AaveV1Helpers {
uint rateMode
) internal returns (uint) {
if (amt > 0) {
address _token = address(token) == getWethAddr() ? getEthAddr() : address(token);
bool isEth = address(token) == getWethAddr();
address _token = isEth ? getEthAddr() : address(token);
if (amt == uint(-1)) {
amt = getMaxBorrow(target, _token, ctoken, rateMode);
@ -899,8 +901,6 @@ contract AaveV2Helpers is AaveV1Helpers {
(uint feeAmt, uint _amt) = calculateFee(amt, fee, true);
bool isEth = address(token) == getWethAddr();
aave.borrow(address(token), _amt, rateMode, getReferralCode(), address(this));
convertWethToEth(isEth, token, amt);