fix: added check to avoid dropped reserves

This commit is contained in:
The3D 2021-06-01 20:41:35 +02:00
parent 054dd5973e
commit 0326259c03

View File

@ -543,6 +543,12 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
function mintToTreasury() public {
for (uint256 i = 0; i < _reservesCount; i++) {
address reserveAddress = _reservesList[i];
// if a reserve has been dropped this might happen
if(reserveAddress == address(0)){
continue;
}
DataTypes.ReserveData storage reserve = _reserves[reserveAddress];
uint256 accruedToTreasury = reserve.accruedToTreasury;