mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Fixed memory usage
This commit is contained in:
parent
9b509eadbb
commit
9e62528b98
|
@ -349,13 +349,15 @@ abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapt
|
||||||
|
|
||||||
if (reserveIn == reserveOut) {
|
if (reserveIn == reserveOut) {
|
||||||
uint256 reserveDecimals = _getDecimals(reserveIn);
|
uint256 reserveDecimals = _getDecimals(reserveIn);
|
||||||
|
address[] memory _reserveIn = new address[](1);
|
||||||
|
_reserveIn[0] = reserveIn;
|
||||||
return
|
return
|
||||||
AmountCalc(
|
AmountCalc(
|
||||||
finalAmountIn,
|
finalAmountIn,
|
||||||
finalAmountIn.mul(10**18).div(amountIn),
|
finalAmountIn.mul(10**18).div(amountIn),
|
||||||
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
||||||
_calcUsdValue(reserveIn, finalAmountIn, reserveDecimals),
|
_calcUsdValue(reserveIn, finalAmountIn, reserveDecimals),
|
||||||
[reserveIn]
|
_reserveIn
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,13 +439,15 @@ abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapt
|
||||||
// Add flash loan fee
|
// Add flash loan fee
|
||||||
uint256 amountIn = amountOut.add(amountOut.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000));
|
uint256 amountIn = amountOut.add(amountOut.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000));
|
||||||
uint256 reserveDecimals = _getDecimals(reserveIn);
|
uint256 reserveDecimals = _getDecimals(reserveIn);
|
||||||
|
address[] memory _reserveIn = new address[](1);
|
||||||
|
_reserveIn[0] = reserveIn;
|
||||||
return
|
return
|
||||||
AmountCalc(
|
AmountCalc(
|
||||||
amountIn,
|
amountIn,
|
||||||
amountOut.mul(10**18).div(amountIn),
|
amountOut.mul(10**18).div(amountIn),
|
||||||
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
||||||
_calcUsdValue(reserveIn, amountOut, reserveDecimals),
|
_calcUsdValue(reserveIn, amountOut, reserveDecimals),
|
||||||
[reserveIn]
|
_reserveIn
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user