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) {
|
||||
uint256 reserveDecimals = _getDecimals(reserveIn);
|
||||
address[] memory _reserveIn = new address[](1);
|
||||
_reserveIn[0] = reserveIn;
|
||||
return
|
||||
AmountCalc(
|
||||
finalAmountIn,
|
||||
finalAmountIn.mul(10**18).div(amountIn),
|
||||
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
||||
_calcUsdValue(reserveIn, finalAmountIn, reserveDecimals),
|
||||
[reserveIn]
|
||||
_reserveIn
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -437,13 +439,15 @@ abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapt
|
|||
// Add flash loan fee
|
||||
uint256 amountIn = amountOut.add(amountOut.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000));
|
||||
uint256 reserveDecimals = _getDecimals(reserveIn);
|
||||
address[] memory _reserveIn = new address[](1);
|
||||
_reserveIn[0] = reserveIn;
|
||||
return
|
||||
AmountCalc(
|
||||
amountIn,
|
||||
amountOut.mul(10**18).div(amountIn),
|
||||
_calcUsdValue(reserveIn, amountIn, reserveDecimals),
|
||||
_calcUsdValue(reserveIn, amountOut, reserveDecimals),
|
||||
[reserveIn]
|
||||
_reserveIn
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user