Merge branch 'fix/42' into 'master'

Resolve "Ensure that no more than 128 assets can be added to the reserve"

Closes #42

See merge request aave-tech/protocol-v2!53
This commit is contained in:
Ernesto Boado 2020-09-21 18:34:31 +00:00
commit ed4e54d4c3
2 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
uint256 public constant REBALANCE_DOWN_RATE_DELTA = (1e27) / 5;
uint256 public constant MAX_STABLE_RATE_BORROW_SIZE_PERCENT = 25;
uint256 public constant FLASHLOAN_PREMIUM_TOTAL = 9;
uint256 public constant UINT_MAX_VALUE = uint256(-1);
uint256 public constant MAX_NUMBER_RESERVES = 128;
uint256 public constant LENDINGPOOL_REVISION = 0x2;
/**
@ -934,6 +934,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
**/
function _addReserveToList(address asset) internal {
bool reserveAlreadyAdded = false;
require(_reservesList.length < MAX_NUMBER_RESERVES, Errors.NO_MORE_RESERVES_ALLOWED);
for (uint256 i = 0; i < _reservesList.length; i++)
if (_reservesList[i] == asset) {
reserveAlreadyAdded = true;

View File

@ -43,6 +43,7 @@ library Errors {
string public constant FAILED_REPAY_WITH_COLLATERAL = '53';
string public constant FAILED_COLLATERAL_SWAP = '55';
string public constant INVALID_EQUAL_ASSETS_TO_SWAP = '56';
string public constant NO_MORE_RESERVES_ALLOWED = '59';
// require error messages - aToken
string public constant CALLER_MUST_BE_LENDING_POOL = '28'; // 'The caller of this function must be a lending pool'