mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'fix/137' into 'master'
Resolve "Remove conditions that check if liquidityIndex and variableBorrowIndex are == 0 in initReserve" Closes #137 See merge request aave-tech/protocol-v2!150
This commit is contained in:
commit
fe1eab670a
|
@ -185,15 +185,9 @@ library ReserveLogic {
|
|||
address interestRateStrategyAddress
|
||||
) external {
|
||||
require(reserve.aTokenAddress == address(0), Errors.RL_RESERVE_ALREADY_INITIALIZED);
|
||||
if (reserve.liquidityIndex == 0) {
|
||||
//if the reserve has not been initialized yet
|
||||
reserve.liquidityIndex = uint128(WadRayMath.ray());
|
||||
}
|
||||
|
||||
if (reserve.variableBorrowIndex == 0) {
|
||||
reserve.variableBorrowIndex = uint128(WadRayMath.ray());
|
||||
}
|
||||
|
||||
|
||||
reserve.liquidityIndex = uint128(WadRayMath.ray());
|
||||
reserve.variableBorrowIndex = uint128(WadRayMath.ray());
|
||||
reserve.aTokenAddress = aTokenAddress;
|
||||
reserve.stableDebtTokenAddress = stableDebtTokenAddress;
|
||||
reserve.variableDebtTokenAddress = variableDebtTokenAddress;
|
||||
|
|
Loading…
Reference in New Issue
Block a user