mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'fix/159' into 'master'
Resolve "Fix the updateInterestRates on flashloan" Closes #159 See merge request aave-tech/protocol-v2!180
This commit is contained in:
commit
2adbc54475
|
@ -525,7 +525,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
_reserves[vars.currentAsset].updateInterestRates(
|
_reserves[vars.currentAsset].updateInterestRates(
|
||||||
vars.currentAsset,
|
vars.currentAsset,
|
||||||
vars.currentATokenAddress,
|
vars.currentATokenAddress,
|
||||||
vars.currentPremium,
|
vars.currentAmountPlusPremium,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => {
|
||||||
|
|
||||||
await _mockFlashLoanReceiver.setFailExecutionTransfer(false);
|
await _mockFlashLoanReceiver.setFailExecutionTransfer(false);
|
||||||
|
|
||||||
|
const reserveDataBefore = await helpersContract.getReserveData(usdc.address);
|
||||||
|
|
||||||
const flashloanAmount = await convertToCurrencyDecimals(usdc.address, '500');
|
const flashloanAmount = await convertToCurrencyDecimals(usdc.address, '500');
|
||||||
|
|
||||||
await pool.flashLoan(
|
await pool.flashLoan(
|
||||||
|
@ -264,6 +266,9 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => {
|
||||||
'0'
|
'0'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const reserveDataAfter = helpersContract.getReserveData(usdc.address);
|
||||||
|
|
||||||
|
|
||||||
const reserveData = await helpersContract.getReserveData(usdc.address);
|
const reserveData = await helpersContract.getReserveData(usdc.address);
|
||||||
const userData = await helpersContract.getUserReserveData(usdc.address, depositor.address);
|
const userData = await helpersContract.getUserReserveData(usdc.address, depositor.address);
|
||||||
|
|
||||||
|
|
|
@ -1194,7 +1194,7 @@ const calcCompoundedInterest = (
|
||||||
.plus(thirdTerm);
|
.plus(thirdTerm);
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcExpectedInterestRates = (
|
export const calcExpectedInterestRates = (
|
||||||
reserveSymbol: string,
|
reserveSymbol: string,
|
||||||
marketStableRate: BigNumber,
|
marketStableRate: BigNumber,
|
||||||
utilizationRate: BigNumber,
|
utilizationRate: BigNumber,
|
||||||
|
@ -1253,7 +1253,7 @@ const calcExpectedInterestRates = (
|
||||||
return [liquidityRate, stableBorrowRate, variableBorrowRate];
|
return [liquidityRate, stableBorrowRate, variableBorrowRate];
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcExpectedOverallBorrowRate = (
|
export const calcExpectedOverallBorrowRate = (
|
||||||
totalStableDebt: BigNumber,
|
totalStableDebt: BigNumber,
|
||||||
totalVariableDebt: BigNumber,
|
totalVariableDebt: BigNumber,
|
||||||
currentVariableBorrowRate: BigNumber,
|
currentVariableBorrowRate: BigNumber,
|
||||||
|
@ -1274,7 +1274,7 @@ const calcExpectedOverallBorrowRate = (
|
||||||
return overallBorrowRate;
|
return overallBorrowRate;
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcExpectedUtilizationRate = (
|
export const calcExpectedUtilizationRate = (
|
||||||
totalStableDebt: BigNumber,
|
totalStableDebt: BigNumber,
|
||||||
totalVariableDebt: BigNumber,
|
totalVariableDebt: BigNumber,
|
||||||
totalLiquidity: BigNumber
|
totalLiquidity: BigNumber
|
||||||
|
|
Loading…
Reference in New Issue
Block a user