mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
- Fixed array init on BaseUniswapAdapter
This commit is contained in:
parent
6cebf50f11
commit
d6059938bb
|
@ -348,13 +348,16 @@ abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapt
|
||||||
|
|
||||||
if (reserveIn == reserveOut) {
|
if (reserveIn == reserveOut) {
|
||||||
uint256 reserveDecimals = _getDecimals(reserveIn);
|
uint256 reserveDecimals = _getDecimals(reserveIn);
|
||||||
|
address[] memory path = new address[](1);
|
||||||
|
path[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]
|
path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,13 +439,16 @@ 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 path = new address[](1);
|
||||||
|
path[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]
|
path
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user