From e39cf64183d11c5349aef4068fd9718ef6b579d5 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 14:50:28 +0200
Subject: [PATCH 1/9] Updated ReserveConfiguration

---
 .../configuration/ReserveConfiguration.sol    | 131 +++++++++---------
 1 file changed, 64 insertions(+), 67 deletions(-)

diff --git a/contracts/libraries/configuration/ReserveConfiguration.sol b/contracts/libraries/configuration/ReserveConfiguration.sol
index fe2cf490..46ad9ba9 100644
--- a/contracts/libraries/configuration/ReserveConfiguration.sol
+++ b/contracts/libraries/configuration/ReserveConfiguration.sol
@@ -36,174 +36,171 @@ library ReserveConfiguration {
 
   /**
    * @dev sets the Loan to Value of the reserve
-   * @param _self the reserve configuration
-   * @param _ltv the new ltv
+   * @param self the reserve configuration
+   * @param ltv the new ltv
    **/
-  function setLtv(ReserveConfiguration.Map memory _self, uint256 _ltv) internal {
-    _self.data = (_self.data & LTV_MASK) | _ltv;
+  function setLtv(ReserveConfiguration.Map memory self, uint256 ltv) internal pure {
+    self.data = (self.data & LTV_MASK) | ltv;
   }
 
   /**
    * @dev gets the Loan to Value of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the loan to value
    **/
-  function getLtv(ReserveConfiguration.Map storage _self) internal view returns (uint256) {
-    return _self.data & ~LTV_MASK;
+  function getLtv(ReserveConfiguration.Map storage self) internal view returns (uint256) {
+    return self.data & ~LTV_MASK;
   }
 
   /**
    * @dev sets the liquidation threshold of the reserve
-   * @param _self the reserve configuration
-   * @param _threshold the new liquidation threshold
+   * @param self the reserve configuration
+   * @param threshold the new liquidation threshold
    **/
-  function setLiquidationThreshold(ReserveConfiguration.Map memory _self, uint256 _threshold)
+  function setLiquidationThreshold(ReserveConfiguration.Map memory self, uint256 threshold)
     internal
+    pure
   {
-    _self.data = (_self.data & LIQUIDATION_THRESHOLD_MASK) | (_threshold << 16);
+    self.data = (self.data & LIQUIDATION_THRESHOLD_MASK) | (threshold << 16);
   }
 
   /**
    * @dev gets the Loan to Value of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the liquidation threshold
    **/
-  function getLiquidationThreshold(ReserveConfiguration.Map storage _self)
+  function getLiquidationThreshold(ReserveConfiguration.Map storage self)
     internal
     view
     returns (uint256)
   {
-    return (_self.data & ~LIQUIDATION_THRESHOLD_MASK) >> 16;
+    return (self.data & ~LIQUIDATION_THRESHOLD_MASK) >> 16;
   }
 
   /**
    * @dev sets the liquidation bonus of the reserve
-   * @param _self the reserve configuration
-   * @param _bonus the new liquidation bonus
+   * @param self the reserve configuration
+   * @param bonus the new liquidation bonus
    **/
-  function setLiquidationBonus(ReserveConfiguration.Map memory _self, uint256 _bonus) internal {
-    _self.data = (_self.data & LIQUIDATION_BONUS_MASK) | (_bonus << 32);
+  function setLiquidationBonus(ReserveConfiguration.Map memory self, uint256 bonus) internal pure {
+    self.data = (self.data & LIQUIDATION_BONUS_MASK) | (bonus << 32);
   }
 
   /**
    * @dev gets the liquidation bonus of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the liquidation bonus
    **/
-  function getLiquidationBonus(ReserveConfiguration.Map storage _self)
+  function getLiquidationBonus(ReserveConfiguration.Map storage self)
     internal
     view
     returns (uint256)
   {
-    return (_self.data & ~LIQUIDATION_BONUS_MASK) >> 32;
+    return (self.data & ~LIQUIDATION_BONUS_MASK) >> 32;
   }
 
   /**
    * @dev sets the decimals of the underlying asset of the reserve
-   * @param _self the reserve configuration
-   * @param _decimals the decimals
+   * @param self the reserve configuration
+   * @param decimals the decimals
    **/
-  function setDecimals(ReserveConfiguration.Map memory _self, uint256 _decimals) internal {
-    _self.data = (_self.data & DECIMALS_MASK) | (_decimals << 48);
+  function setDecimals(ReserveConfiguration.Map memory self, uint256 decimals) internal pure {
+    self.data = (self.data & DECIMALS_MASK) | (decimals << 48);
   }
 
   /**
    * @dev gets the decimals of the underlying asset of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the decimals of the asset
    **/
-  function getDecimals(ReserveConfiguration.Map storage _self) internal view returns (uint256) {
-    return (_self.data & ~DECIMALS_MASK) >> 48;
+  function getDecimals(ReserveConfiguration.Map storage self) internal view returns (uint256) {
+    return (self.data & ~DECIMALS_MASK) >> 48;
   }
 
   /**
    * @dev sets the active state of the reserve
-   * @param _self the reserve configuration
-   * @param _active the active state
+   * @param self the reserve configuration
+   * @param active the active state
    **/
-  function setActive(ReserveConfiguration.Map memory _self, bool _active) internal {
-    _self.data = (_self.data & ACTIVE_MASK) | (uint256(_active ? 1 : 0) << 56);
+  function setActive(ReserveConfiguration.Map memory self, bool active) internal {
+    self.data = (self.data & ACTIVE_MASK) | (uint256(active ? 1 : 0) << 56);
   }
 
   /**
    * @dev gets the active state of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the active state
    **/
-  function getActive(ReserveConfiguration.Map storage _self) internal view returns (bool) {
-    return ((_self.data & ~ACTIVE_MASK) >> 56) != 0;
+  function getActive(ReserveConfiguration.Map storage self) internal view returns (bool) {
+    return ((self.data & ~ACTIVE_MASK) >> 56) != 0;
   }
 
   /**
    * @dev sets the frozen state of the reserve
-   * @param _self the reserve configuration
-   * @param _frozen the frozen state
+   * @param self the reserve configuration
+   * @param frozen the frozen state
    **/
-  function setFrozen(ReserveConfiguration.Map memory _self, bool _frozen) internal {
-    _self.data = (_self.data & FROZEN_MASK) | (uint256(_frozen ? 1 : 0) << 57);
+  function setFrozen(ReserveConfiguration.Map memory self, bool frozen) internal pure {
+    self.data = (self.data & FROZEN_MASK) | (uint256(frozen ? 1 : 0) << 57);
   }
 
   /**
    * @dev gets the frozen state of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the frozen state
    **/
-  function getFrozen(ReserveConfiguration.Map storage _self) internal view returns (bool) {
-    return ((_self.data & ~FROZEN_MASK) >> 57) != 0;
+  function getFrozen(ReserveConfiguration.Map storage self) internal view returns (bool) {
+    return ((self.data & ~FROZEN_MASK) >> 57) != 0;
   }
 
   /**
    * @dev enables or disables borrowing on the reserve
-   * @param _self the reserve configuration
-   * @param _enabled true if the borrowing needs to be enabled, false otherwise
+   * @param self the reserve configuration
+   * @param enabled true if the borrowing needs to be enabled, false otherwise
    **/
-  function setBorrowingEnabled(ReserveConfiguration.Map memory _self, bool _enabled) internal {
-    _self.data = (_self.data & BORROWING_MASK) | (uint256(_enabled ? 1 : 0) << 58);
+  function setBorrowingEnabled(ReserveConfiguration.Map memory self, bool enabled) internal pure {
+    self.data = (self.data & BORROWING_MASK) | (uint256(enabled ? 1 : 0) << 58);
   }
 
   /**
    * @dev gets the borrowing state of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the borrowing state
    **/
-  function getBorrowingEnabled(ReserveConfiguration.Map storage _self)
-    internal
-    view
-    returns (bool)
-  {
-    return ((_self.data & ~BORROWING_MASK) >> 58) != 0;
+  function getBorrowingEnabled(ReserveConfiguration.Map storage self) internal view returns (bool) {
+    return ((self.data & ~BORROWING_MASK) >> 58) != 0;
   }
 
   /**
    * @dev enables or disables stable rate borrowing on the reserve
-   * @param _self the reserve configuration
-   * @param _enabled true if the stable rate borrowing needs to be enabled, false otherwise
+   * @param self the reserve configuration
+   * @param enabled true if the stable rate borrowing needs to be enabled, false otherwise
    **/
-  function setStableRateBorrowingEnabled(ReserveConfiguration.Map memory _self, bool _enabled)
-    internal
+  function setStableRateBorrowingEnabled(ReserveConfiguration.Map memory self, bool enabled)
+    internal pure
   {
-    _self.data = (_self.data & STABLE_BORROWING_MASK) | (uint256(_enabled ? 1 : 0) << 59);
+    self.data = (self.data & STABLE_BORROWING_MASK) | (uint256(enabled ? 1 : 0) << 59);
   }
 
   /**
    * @dev gets the stable rate borrowing state of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the stable rate borrowing state
    **/
-  function getStableRateBorrowingEnabled(ReserveConfiguration.Map storage _self)
+  function getStableRateBorrowingEnabled(ReserveConfiguration.Map storage self)
     internal
     view
     returns (bool)
   {
-    return ((_self.data & ~STABLE_BORROWING_MASK) >> 59) != 0;
+    return ((self.data & ~STABLE_BORROWING_MASK) >> 59) != 0;
   }
 
   /**
    * @dev gets the configuration flags of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the state flags representing active, freezed, borrowing enabled, stableRateBorrowing enabled
    **/
-  function getFlags(ReserveConfiguration.Map storage _self)
+  function getFlags(ReserveConfiguration.Map storage self)
     internal
     view
     returns (
@@ -213,7 +210,7 @@ library ReserveConfiguration {
       bool
     )
   {
-    uint256 dataLocal = _self.data;
+    uint256 dataLocal = self.data;
 
     return (
       (dataLocal & ~ACTIVE_MASK) >> 56 != 0,
@@ -225,10 +222,10 @@ library ReserveConfiguration {
 
   /**
    * @dev gets the configuration paramters of the reserve
-   * @param _self the reserve configuration
+   * @param self the reserve configuration
    * @return the state params representing ltv, liquidation threshold, liquidation bonus, the reserve decimals
    **/
-  function getParams(ReserveConfiguration.Map storage _self)
+  function getParams(ReserveConfiguration.Map storage self)
     internal
     view
     returns (
@@ -238,7 +235,7 @@ library ReserveConfiguration {
       uint256
     )
   {
-    uint256 dataLocal = _self.data;
+    uint256 dataLocal = self.data;
 
     return (
       dataLocal & ~LTV_MASK,

From b13e08cfde99d04b2c69537d4bf916a79ab1e3f5 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 14:52:10 +0200
Subject: [PATCH 2/9] Fixed UserConfiguration

---
 .../configuration/UserConfiguration.sol       | 78 +++++++++----------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/contracts/libraries/configuration/UserConfiguration.sol b/contracts/libraries/configuration/UserConfiguration.sol
index 9c41f332..45802f31 100644
--- a/contracts/libraries/configuration/UserConfiguration.sol
+++ b/contracts/libraries/configuration/UserConfiguration.sol
@@ -18,94 +18,94 @@ library UserConfiguration {
   }
 
   /**
-   * @dev sets if the user is borrowing the reserve identified by _reserveIndex
-   * @param _self the configuration object
-   * @param _reserveIndex the index of the reserve in the bitmap
-   * @param _borrowing true if the user is borrowing the reserve, false otherwise
+   * @dev sets if the user is borrowing the reserve identified by reserveIndex
+   * @param self the configuration object
+   * @param reserveIndex the index of the reserve in the bitmap
+   * @param borrowing true if the user is borrowing the reserve, false otherwise
    **/
   function setBorrowing(
-    UserConfiguration.Map storage _self,
-    uint256 _reserveIndex,
-    bool _borrowing
+    UserConfiguration.Map storage self,
+    uint256 reserveIndex,
+    bool borrowing
   ) internal {
-    _self.data =
-      (_self.data & ~(1 << (_reserveIndex * 2))) |
-      (uint256(_borrowing ? 1 : 0) << (_reserveIndex * 2));
+    self.data =
+      (self.data & ~(1 << (reserveIndex * 2))) |
+      (uint256(borrowing ? 1 : 0) << (reserveIndex * 2));
   }
 
   /**
-   * @dev sets if the user is using as collateral the reserve identified by _reserveIndex
-   * @param _self the configuration object
-   * @param _reserveIndex the index of the reserve in the bitmap
+   * @dev sets if the user is using as collateral the reserve identified by reserveIndex
+   * @param self the configuration object
+   * @param reserveIndex the index of the reserve in the bitmap
    * @param _usingAsCollateral true if the user is usin the reserve as collateral, false otherwise
    **/
   function setUsingAsCollateral(
-    UserConfiguration.Map storage _self,
-    uint256 _reserveIndex,
+    UserConfiguration.Map storage self,
+    uint256 reserveIndex,
     bool _usingAsCollateral
   ) internal {
-    _self.data =
-      (_self.data & ~(1 << (_reserveIndex * 2 + 1))) |
-      (uint256(_usingAsCollateral ? 1 : 0) << (_reserveIndex * 2 + 1));
+    self.data =
+      (self.data & ~(1 << (reserveIndex * 2 + 1))) |
+      (uint256(_usingAsCollateral ? 1 : 0) << (reserveIndex * 2 + 1));
   }
 
   /**
    * @dev used to validate if a user has been using the reserve for borrowing or as collateral
-   * @param _self the configuration object
-   * @param _reserveIndex the index of the reserve in the bitmap
+   * @param self the configuration object
+   * @param reserveIndex the index of the reserve in the bitmap
    * @return true if the user has been using a reserve for borrowing or as collateral, false otherwise
    **/
-  function isUsingAsCollateralOrBorrowing(UserConfiguration.Map memory _self, uint256 _reserveIndex)
+  function isUsingAsCollateralOrBorrowing(UserConfiguration.Map memory self, uint256 reserveIndex)
     internal
-    view
+    pure
     returns (bool)
   {
-    return (_self.data >> (_reserveIndex * 2)) & 3 != 0;
+    return (self.data >> (reserveIndex * 2)) & 3 != 0;
   }
 
   /**
    * @dev used to validate if a user has been using the reserve for borrowing
-   * @param _self the configuration object
-   * @param _reserveIndex the index of the reserve in the bitmap
+   * @param self the configuration object
+   * @param reserveIndex the index of the reserve in the bitmap
    * @return true if the user has been using a reserve for borrowing, false otherwise
    **/
-  function isBorrowing(UserConfiguration.Map memory _self, uint256 _reserveIndex)
+  function isBorrowing(UserConfiguration.Map memory self, uint256 reserveIndex)
     internal
-    view
+    pure
     returns (bool)
   {
-    return (_self.data >> (_reserveIndex * 2)) & 1 != 0;
+    return (self.data >> (reserveIndex * 2)) & 1 != 0;
   }
 
   /**
    * @dev used to validate if a user has been using the reserve as collateral
-   * @param _self the configuration object
-   * @param _reserveIndex the index of the reserve in the bitmap
+   * @param self the configuration object
+   * @param reserveIndex the index of the reserve in the bitmap
    * @return true if the user has been using a reserve as collateral, false otherwise
    **/
-  function isUsingAsCollateral(UserConfiguration.Map memory _self, uint256 _reserveIndex)
+  function isUsingAsCollateral(UserConfiguration.Map memory self, uint256 reserveIndex)
     internal
-    view
+    pure
     returns (bool)
   {
-    return (_self.data >> (_reserveIndex * 2 + 1)) & 1 != 0;
+    return (self.data >> (reserveIndex * 2 + 1)) & 1 != 0;
   }
 
   /**
    * @dev used to validate if a user has been borrowing from any reserve
-   * @param _self the configuration object
+   * @param self the configuration object
    * @return true if the user has been borrowing any reserve, false otherwise
    **/
-  function isBorrowingAny(UserConfiguration.Map memory _self) internal view returns (bool) {
-    return _self.data & BORROWING_MASK != 0;
+  function isBorrowingAny(UserConfiguration.Map memory self) internal pure returns (bool) {
+    return self.data & BORROWING_MASK != 0;
   }
 
   /**
    * @dev used to validate if a user has not been using any reserve
-   * @param _self the configuration object
+   * @param self the configuration object
    * @return true if the user has been borrowing any reserve, false otherwise
    **/
-  function isEmpty(UserConfiguration.Map memory _self) internal view returns (bool) {
-    return _self.data == 0;
+  function isEmpty(UserConfiguration.Map memory self) internal pure returns (bool) {
+    return self.data == 0;
   }
 }

From e948101f879f795379e79df3cf337a654d23709e Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 14:54:07 +0200
Subject: [PATCH 3/9] Fixed Helpers

---
 contracts/libraries/helpers/Helpers.sol | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/contracts/libraries/helpers/Helpers.sol b/contracts/libraries/helpers/Helpers.sol
index 8f0b2db2..dda22eb4 100644
--- a/contracts/libraries/helpers/Helpers.sol
+++ b/contracts/libraries/helpers/Helpers.sol
@@ -12,35 +12,35 @@ import {ReserveLogic} from '../logic/ReserveLogic.sol';
 library Helpers {
   /**
    * @dev fetches the user current stable and variable debt balances
-   * @param _user the user
-   * @param _reserve the reserve object
+   * @param user the user
+   * @param reserve the reserve object
    * @return the stable and variable debt balance
    **/
-  function getUserCurrentDebt(address _user, ReserveLogic.ReserveData storage _reserve)
+  function getUserCurrentDebt(address user, ReserveLogic.ReserveData storage reserve)
     internal
     view
     returns (uint256, uint256)
   {
     return (
-      DebtTokenBase(_reserve.stableDebtTokenAddress).balanceOf(_user),
-      DebtTokenBase(_reserve.variableDebtTokenAddress).balanceOf(_user)
+      DebtTokenBase(reserve.stableDebtTokenAddress).balanceOf(user),
+      DebtTokenBase(reserve.variableDebtTokenAddress).balanceOf(user)
     );
   }
 
   /**
    * @dev fetches the user principal stable and variable debt balances
-   * @param _user the user
-   * @param _reserve the reserve object
+   * @param user the user
+   * @param reserve the reserve object
    * @return the stable and variable debt balance
    **/
-  function getUserPrincipalDebt(address _user, ReserveLogic.ReserveData storage _reserve)
+  function getUserPrincipalDebt(address user, ReserveLogic.ReserveData storage reserve)
     internal
     view
     returns (uint256, uint256)
   {
     return (
-      DebtTokenBase(_reserve.stableDebtTokenAddress).principalBalanceOf(_user),
-      DebtTokenBase(_reserve.variableDebtTokenAddress).principalBalanceOf(_user)
+      DebtTokenBase(reserve.stableDebtTokenAddress).principalBalanceOf(user),
+      DebtTokenBase(reserve.variableDebtTokenAddress).principalBalanceOf(user)
     );
   }
 }

From 86541b3fe5eee25d0a9a93684d4d2722bcfe3518 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 14:58:30 +0200
Subject: [PATCH 4/9] Fixed GenericLogic

---
 contracts/libraries/logic/GenericLogic.sol | 80 ++++++++++++----------
 1 file changed, 42 insertions(+), 38 deletions(-)

diff --git a/contracts/libraries/logic/GenericLogic.sol b/contracts/libraries/logic/GenericLogic.sol
index c8186ce1..ead09d38 100644
--- a/contracts/libraries/logic/GenericLogic.sol
+++ b/contracts/libraries/logic/GenericLogic.sol
@@ -43,23 +43,27 @@ library GenericLogic {
   /**
    * @dev check if a specific balance decrease is allowed
    * (i.e. doesn't bring the user borrow position health factor under HEALTH_FACTOR_LIQUIDATION_THRESHOLD)
-   * @param _reserve the address of the reserve
-   * @param _user the address of the user
-   * @param _amount the amount to decrease
+   * @param asset the address of the reserve
+   * @param user the address of the user
+   * @param amount the amount to decrease
+   * @param reservesData the data of all the reserves
+   * @param userConfig the user configuration
+   * @param reserves the list of all the active reserves
+   * @param oracle the address of the oracle contract
    * @return true if the decrease of the balance is allowed
    **/
   function balanceDecreaseAllowed(
-    address _reserve,
-    address _user,
-    uint256 _amount,
-    mapping(address => ReserveLogic.ReserveData) storage _reservesData,
-    UserConfiguration.Map calldata _userConfig,
-    address[] calldata _reserves,
-    address _oracle
+    address asset,
+    address user,
+    uint256 amount,
+    mapping(address => ReserveLogic.ReserveData) storage reservesData,
+    UserConfiguration.Map calldata userConfig,
+    address[] calldata reserves,
+    address oracle
   ) external view returns (bool) {
     if (
-      !_userConfig.isBorrowingAny() ||
-      !_userConfig.isUsingAsCollateral(_reservesData[_reserve].index)
+      !userConfig.isBorrowingAny() ||
+      !userConfig.isUsingAsCollateral(reservesData[asset].index)
     ) {
       return true;
     }
@@ -67,7 +71,7 @@ library GenericLogic {
     // Usage of a memory struct of vars to avoid "Stack too deep" errors due to local variables
     balanceDecreaseAllowedLocalVars memory vars;
 
-    (vars.ltv, , , vars.decimals) = _reservesData[_reserve].configuration.getParams();
+    (vars.ltv, , , vars.decimals) = reservesData[asset].configuration.getParams();
 
     if (vars.ltv == 0) {
       return true; //if reserve is not used as collateral, no reasons to block the transfer
@@ -79,13 +83,13 @@ library GenericLogic {
       ,
       vars.currentLiquidationThreshold,
 
-    ) = calculateUserAccountData(_user, _reservesData, _userConfig, _reserves, _oracle);
+    ) = calculateUserAccountData(user, reservesData, userConfig, reserves, oracle);
 
     if (vars.borrowBalanceETH == 0) {
       return true; //no borrows - no reasons to block the transfer
     }
 
-    vars.amountToDecreaseETH = IPriceOracleGetter(_oracle).getAssetPrice(_reserve).mul(_amount).div(
+    vars.amountToDecreaseETH = IPriceOracleGetter(oracle).getAssetPrice(asset).mul(amount).div(
       10**vars.decimals
     );
 
@@ -137,20 +141,20 @@ library GenericLogic {
    * @dev calculates the user data across the reserves.
    * this includes the total liquidity/collateral/borrow balances in ETH,
    * the average Loan To Value, the average Liquidation Ratio, and the Health factor.
-   * @param _user the address of the user
-   * @param _reservesData data of all the reserves
-   * @param _userConfig the configuration of the user
-   * @param _reserves the list of the available reserves
-   * @param _oracle the price oracle address
+   * @param user the address of the user
+   * @param reservesData data of all the reserves
+   * @param userConfig the configuration of the user
+   * @param reserves the list of the available reserves
+   * @param oracle the price oracle address
    * @return the total collateral and total borrow balance of the user in ETH, the avg ltv and liquidation threshold and the HF
    * also the average Ltv, liquidation threshold, and the health factor
    **/
   function calculateUserAccountData(
-    address _user,
-    mapping(address => ReserveLogic.ReserveData) storage _reservesData,
-    UserConfiguration.Map memory _userConfig,
-    address[] memory _reserves,
-    address _oracle
+    address user,
+    mapping(address => ReserveLogic.ReserveData) storage reservesData,
+    UserConfiguration.Map memory userConfig,
+    address[] memory reserves,
+    address oracle
   )
     internal
     view
@@ -164,26 +168,26 @@ library GenericLogic {
   {
     CalculateUserAccountDataVars memory vars;
 
-    if (_userConfig.isEmpty()) {
+    if (userConfig.isEmpty()) {
       return (0, 0, 0, 0, uint256(-1));
     }
-    for (vars.i = 0; vars.i < _reserves.length; vars.i++) {
-      if (!_userConfig.isUsingAsCollateralOrBorrowing(vars.i)) {
+    for (vars.i = 0; vars.i < reserves.length; vars.i++) {
+      if (!userConfig.isUsingAsCollateralOrBorrowing(vars.i)) {
         continue;
       }
 
-      vars.currentReserveAddress = _reserves[vars.i];
-      ReserveLogic.ReserveData storage currentReserve = _reservesData[vars.currentReserveAddress];
+      vars.currentReserveAddress = reserves[vars.i];
+      ReserveLogic.ReserveData storage currentReserve = reservesData[vars.currentReserveAddress];
 
       (vars.ltv, vars.liquidationThreshold, , vars.decimals) = currentReserve
         .configuration
         .getParams();
 
       vars.tokenUnit = 10**vars.decimals;
-      vars.reserveUnitPrice = IPriceOracleGetter(_oracle).getAssetPrice(vars.currentReserveAddress);
+      vars.reserveUnitPrice = IPriceOracleGetter(oracle).getAssetPrice(vars.currentReserveAddress);
 
-      if (vars.ltv != 0 && _userConfig.isUsingAsCollateral(vars.i)) {
-        vars.compoundedLiquidityBalance = IERC20(currentReserve.aTokenAddress).balanceOf(_user);
+      if (vars.ltv != 0 && userConfig.isUsingAsCollateral(vars.i)) {
+        vars.compoundedLiquidityBalance = IERC20(currentReserve.aTokenAddress).balanceOf(user);
 
         uint256 liquidityBalanceETH = vars
           .reserveUnitPrice
@@ -198,12 +202,12 @@ library GenericLogic {
         );
       }
 
-      if (_userConfig.isBorrowing(vars.i)) {
+      if (userConfig.isBorrowing(vars.i)) {
         vars.compoundedBorrowBalance = IERC20(currentReserve.stableDebtTokenAddress).balanceOf(
-          _user
+          user
         );
         vars.compoundedBorrowBalance = vars.compoundedBorrowBalance.add(
-          IERC20(currentReserve.variableDebtTokenAddress).balanceOf(_user)
+          IERC20(currentReserve.variableDebtTokenAddress).balanceOf(user)
         );
 
         vars.totalBorrowBalanceETH = vars.totalBorrowBalanceETH.add(
@@ -244,7 +248,7 @@ library GenericLogic {
     uint256 collateralBalanceETH,
     uint256 borrowBalanceETH,
     uint256 liquidationThreshold
-  ) internal view returns (uint256) {
+  ) internal pure returns (uint256) {
     if (borrowBalanceETH == 0) return uint256(-1);
 
     return (collateralBalanceETH.percentMul(liquidationThreshold)).wadDiv(borrowBalanceETH);
@@ -263,7 +267,7 @@ library GenericLogic {
     uint256 collateralBalanceETH,
     uint256 borrowBalanceETH,
     uint256 ltv
-  ) external view returns (uint256) {
+  ) internal pure returns (uint256) {
     uint256 availableBorrowsETH = collateralBalanceETH.percentMul(ltv); //ltv is in percentage
 
     if (availableBorrowsETH < borrowBalanceETH) {

From 8fe40b4639ac6a9080b3a111914ef69259279914 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 15:13:08 +0200
Subject: [PATCH 5/9] Initial update of ReserveLogic

---
 contracts/lendingpool/LendingPool.sol      |  12 +-
 contracts/libraries/logic/ReserveLogic.sol | 154 +++++++++------------
 2 files changed, 75 insertions(+), 91 deletions(-)

diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol
index c028156e..9d93cf4d 100644
--- a/contracts/lendingpool/LendingPool.sol
+++ b/contracts/lendingpool/LendingPool.sol
@@ -677,8 +677,18 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable, ILendingPool {
       'The actual balance of the protocol is inconsistent'
     );
 
-    reserve.updateStateOnFlashLoan(_reserve, availableLiquidityBefore, amountFee);
+       //compounding the cumulated interest
+    reserve.updateCumulativeIndexesAndTimestamp();
 
+    uint256 totalLiquidityBefore = availableLiquidityBefore
+      .add(IERC20(reserve.variableDebtTokenAddress).totalSupply())
+      .add(IERC20(reserve.stableDebtTokenAddress).totalSupply());
+
+    //compounding the received fee into the reserve
+    reserve.cumulateToLiquidityIndex(totalLiquidityBefore, amountFee);
+
+    //refresh interest rates
+    reserve.updateInterestRates(reserve, asset, amountFee, 0);
     //solium-disable-next-line
     emit FlashLoan(_receiver, _reserve, _amount, amountFee, block.timestamp);
   }
diff --git a/contracts/libraries/logic/ReserveLogic.sol b/contracts/libraries/logic/ReserveLogic.sol
index 2515a9d1..1d74c2bc 100644
--- a/contracts/libraries/logic/ReserveLogic.sol
+++ b/contracts/libraries/logic/ReserveLogic.sol
@@ -23,7 +23,6 @@ library ReserveLogic {
 
   /**
    * @dev Emitted when the state of a reserve is updated
-   * @dev NOTE: This event replaces the Deprecated ReserveUpdated() event, which didn't emit the average stable borrow rate
    * @param reserve the address of the reserve
    * @param liquidityRate the new liquidity rate
    * @param stableBorrowRate the new stable borrow rate
@@ -74,21 +73,21 @@ library ReserveLogic {
    * @dev returns the ongoing normalized income for the reserve.
    * a value of 1e27 means there is no income. As time passes, the income is accrued.
    * A value of 2*1e27 means for each unit of assset two units of income have been accrued.
-   * @param _reserve the reserve object
+   * @param reserve the reserve object
    * @return the normalized income. expressed in ray
    **/
-  function getNormalizedIncome(ReserveData storage _reserve) internal view returns (uint256) {
-    uint40 timestamp = _reserve.lastUpdateTimestamp;
+  function getNormalizedIncome(ReserveData storage reserve) internal view returns (uint256) {
+    uint40 timestamp = reserve.lastUpdateTimestamp;
 
     //solium-disable-next-line
     if (timestamp == uint40(block.timestamp)) {
       //if the index was updated in the same block, no need to perform any calculation
-      return _reserve.lastLiquidityCumulativeIndex;
+      return reserve.lastLiquidityCumulativeIndex;
     }
 
     uint256 cumulated = MathUtils
-      .calculateLinearInterest(_reserve.currentLiquidityRate, timestamp)
-      .rayMul(_reserve.lastLiquidityCumulativeIndex);
+      .calculateLinearInterest(reserve.currentLiquidityRate, timestamp)
+      .rayMul(reserve.lastLiquidityCumulativeIndex);
 
     return cumulated;
   }
@@ -97,21 +96,21 @@ library ReserveLogic {
    * @dev returns the ongoing normalized variable debt for the reserve.
    * a value of 1e27 means there is no debt. As time passes, the income is accrued.
    * A value of 2*1e27 means that the debt of the reserve is double the initial amount.
-   * @param _reserve the reserve object
+   * @param reserve the reserve object
    * @return the normalized variable debt. expressed in ray
    **/
-  function getNormalizedDebt(ReserveData storage _reserve) internal view returns (uint256) {
-    uint40 timestamp = _reserve.lastUpdateTimestamp;
+  function getNormalizedDebt(ReserveData storage reserve) internal view returns (uint256) {
+    uint40 timestamp = reserve.lastUpdateTimestamp;
 
     //solium-disable-next-line
     if (timestamp == uint40(block.timestamp)) {
       //if the index was updated in the same block, no need to perform any calculation
-      return _reserve.lastVariableBorrowCumulativeIndex;
+      return reserve.lastVariableBorrowCumulativeIndex;
     }
 
     uint256 cumulated = MathUtils
-      .calculateCompoundedInterest(_reserve.currentVariableBorrowRate, timestamp)
-      .rayMul(_reserve.lastVariableBorrowCumulativeIndex);
+      .calculateCompoundedInterest(reserve.currentVariableBorrowRate, timestamp)
+      .rayMul(reserve.lastVariableBorrowCumulativeIndex);
 
     return cumulated;
   }
@@ -119,153 +118,128 @@ library ReserveLogic {
   /**
    * @dev Updates the liquidity cumulative index Ci and variable borrow cumulative index Bvc. Refer to the whitepaper for
    * a formal specification.
-   * @param _self the reserve object
+   * @param reserve the reserve object
    **/
-  function updateCumulativeIndexesAndTimestamp(ReserveData storage _self) internal {
+  function updateCumulativeIndexesAndTimestamp(ReserveData storage reserve) internal {
     //only cumulating if there is any income being produced
     if (
-      IERC20(_self.variableDebtTokenAddress).totalSupply() > 0 ||
-      IERC20(_self.stableDebtTokenAddress).totalSupply() > 0
+      IERC20(reserve.variableDebtTokenAddress).totalSupply() > 0 ||
+      IERC20(reserve.stableDebtTokenAddress).totalSupply() > 0
     ) {
       uint256 cumulatedLiquidityInterest = MathUtils.calculateLinearInterest(
-        _self.currentLiquidityRate,
-        _self.lastUpdateTimestamp
+        reserve.currentLiquidityRate,
+        reserve.lastUpdateTimestamp
       );
 
-      _self.lastLiquidityCumulativeIndex = cumulatedLiquidityInterest.rayMul(
-        _self.lastLiquidityCumulativeIndex
+      reserve.lastLiquidityCumulativeIndex = cumulatedLiquidityInterest.rayMul(
+        reserve.lastLiquidityCumulativeIndex
       );
 
       uint256 cumulatedVariableBorrowInterest = MathUtils.calculateCompoundedInterest(
-        _self.currentVariableBorrowRate,
-        _self.lastUpdateTimestamp
+        reserve.currentVariableBorrowRate,
+        reserve.lastUpdateTimestamp
       );
-      _self.lastVariableBorrowCumulativeIndex = cumulatedVariableBorrowInterest.rayMul(
-        _self.lastVariableBorrowCumulativeIndex
+      reserve.lastVariableBorrowCumulativeIndex = cumulatedVariableBorrowInterest.rayMul(
+        reserve.lastVariableBorrowCumulativeIndex
       );
     }
 
     //solium-disable-next-line
-    _self.lastUpdateTimestamp = uint40(block.timestamp);
+    reserve.lastUpdateTimestamp = uint40(block.timestamp);
   }
 
   /**
    * @dev accumulates a predefined amount of asset to the reserve as a fixed, one time income. Used for example to accumulate
    * the flashloan fee to the reserve, and spread it through the depositors.
-   * @param _self the reserve object
-   * @param _totalLiquidity the total liquidity available in the reserve
-   * @param _amount the amount to accomulate
+   * @param reserve the reserve object
+   * @param totalLiquidity the total liquidity available in the reserve
+   * @param amount the amount to accomulate
    **/
   function cumulateToLiquidityIndex(
-    ReserveData storage _self,
-    uint256 _totalLiquidity,
-    uint256 _amount
+    ReserveData storage reserve,
+    uint256 totalLiquidity,
+    uint256 amount
   ) internal {
-    uint256 amountToLiquidityRatio = _amount.wadToRay().rayDiv(_totalLiquidity.wadToRay());
+    uint256 amountToLiquidityRatio = amount.wadToRay().rayDiv(totalLiquidity.wadToRay());
 
     uint256 cumulatedLiquidity = amountToLiquidityRatio.add(WadRayMath.ray());
 
-    _self.lastLiquidityCumulativeIndex = cumulatedLiquidity.rayMul(
-      _self.lastLiquidityCumulativeIndex
+    reserve.lastLiquidityCumulativeIndex = cumulatedLiquidity.rayMul(
+      reserve.lastLiquidityCumulativeIndex
     );
   }
 
   /**
    * @dev initializes a reserve
-   * @param _self the reserve object
-   * @param _aTokenAddress the address of the overlying atoken contract
-   * @param _interestRateStrategyAddress the address of the interest rate strategy contract
+   * @param reserve the reserve object
+   * @param aTokenAddress the address of the overlying atoken contract
+   * @param interestRateStrategyAddress the address of the interest rate strategy contract
    **/
   function init(
-    ReserveData storage _self,
-    address _aTokenAddress,
+    ReserveData storage reserve,
+    address aTokenAddress,
     address _stableDebtAddress,
     address _variableDebtAddress,
-    address _interestRateStrategyAddress
+    address interestRateStrategyAddress
   ) external {
-    require(_self.aTokenAddress == address(0), 'Reserve has already been initialized');
-    if (_self.lastLiquidityCumulativeIndex == 0) {
+    require(reserve.aTokenAddress == address(0), 'Reserve has already been initialized');
+    if (reserve.lastLiquidityCumulativeIndex == 0) {
       //if the reserve has not been initialized yet
-      _self.lastLiquidityCumulativeIndex = WadRayMath.ray();
+      reserve.lastLiquidityCumulativeIndex = WadRayMath.ray();
     }
 
-    if (_self.lastVariableBorrowCumulativeIndex == 0) {
-      _self.lastVariableBorrowCumulativeIndex = WadRayMath.ray();
+    if (reserve.lastVariableBorrowCumulativeIndex == 0) {
+      reserve.lastVariableBorrowCumulativeIndex = WadRayMath.ray();
     }
 
-    _self.aTokenAddress = _aTokenAddress;
-    _self.stableDebtTokenAddress = _stableDebtAddress;
-    _self.variableDebtTokenAddress = _variableDebtAddress;
-    _self.interestRateStrategyAddress = _interestRateStrategyAddress;
-  }
-
-  /**
-   * @dev updates the state of the core as a result of a flashloan action
-   * @param _reserve the address of the reserve in which the flashloan is happening
-   * @param _income the income of the protocol as a result of the action
-   **/
-  function updateStateOnFlashLoan(
-    ReserveData storage _reserve,
-    address _reserveAddress,
-    uint256 _availableLiquidityBefore,
-    uint256 _income
-  ) external {
-    //compounding the cumulated interest
-    _reserve.updateCumulativeIndexesAndTimestamp();
-
-    uint256 totalLiquidityBefore = _availableLiquidityBefore
-      .add(IERC20(_reserve.variableDebtTokenAddress).totalSupply())
-      .add(IERC20(_reserve.stableDebtTokenAddress).totalSupply());
-
-    //compounding the received fee into the reserve
-    _reserve.cumulateToLiquidityIndex(totalLiquidityBefore, _income);
-
-    //refresh interest rates
-    updateInterestRates(_reserve, _reserveAddress, _income, 0);
+    reserve.aTokenAddress = aTokenAddress;
+    reserve.stableDebtTokenAddress = _stableDebtAddress;
+    reserve.variableDebtTokenAddress = _variableDebtAddress;
+    reserve.interestRateStrategyAddress = interestRateStrategyAddress;
   }
 
   /**
    * @dev Updates the reserve current stable borrow rate Rf, the current variable borrow rate Rv and the current liquidity rate Rl.
    * Also updates the lastUpdateTimestamp value. Please refer to the whitepaper for further information.
-   * @param _reserve the address of the reserve to be updated
+   * @param reserve the address of the reserve to be updated
    * @param _liquidityAdded the amount of liquidity added to the protocol (deposit or repay) in the previous action
    * @param _liquidityTaken the amount of liquidity taken from the protocol (redeem or borrow)
    **/
   function updateInterestRates(
-    ReserveData storage _reserve,
-    address _reserveAddress,
+    ReserveData storage reserve,
+    address reserveAddress,
     uint256 _liquidityAdded,
     uint256 _liquidityTaken
   ) internal {
-    uint256 currentAvgStableRate = IStableDebtToken(_reserve.stableDebtTokenAddress)
+    uint256 currentAvgStableRate = IStableDebtToken(reserve.stableDebtTokenAddress)
       .getAverageStableRate();
 
-    uint256 balance = IERC20(_reserveAddress).balanceOf(_reserve.aTokenAddress);
+    uint256 balance = IERC20(reserveAddress).balanceOf(reserve.aTokenAddress);
 
     (
       uint256 newLiquidityRate,
       uint256 newStableRate,
       uint256 newVariableRate
-    ) = IReserveInterestRateStrategy(_reserve.interestRateStrategyAddress).calculateInterestRates(
-      _reserveAddress,
+    ) = IReserveInterestRateStrategy(reserve.interestRateStrategyAddress).calculateInterestRates(
+      reserveAddress,
       balance.add(_liquidityAdded).sub(_liquidityTaken),
-      IERC20(_reserve.stableDebtTokenAddress).totalSupply(),
-      IERC20(_reserve.variableDebtTokenAddress).totalSupply(),
+      IERC20(reserve.stableDebtTokenAddress).totalSupply(),
+      IERC20(reserve.variableDebtTokenAddress).totalSupply(),
       currentAvgStableRate
     );
 
-    _reserve.currentLiquidityRate = newLiquidityRate;
-    _reserve.currentStableBorrowRate = newStableRate;
-    _reserve.currentVariableBorrowRate = newVariableRate;
+    reserve.currentLiquidityRate = newLiquidityRate;
+    reserve.currentStableBorrowRate = newStableRate;
+    reserve.currentVariableBorrowRate = newVariableRate;
 
     emit ReserveDataUpdated(
-      _reserveAddress,
+      reserveAddress,
       newLiquidityRate,
       newStableRate,
       currentAvgStableRate,
       newVariableRate,
-      _reserve.lastLiquidityCumulativeIndex,
-      _reserve.lastVariableBorrowCumulativeIndex
+      reserve.lastLiquidityCumulativeIndex,
+      reserve.lastVariableBorrowCumulativeIndex
     );
   }
 }

From 1864c7abf47f5ce93ebb54d982a192dc84750b3d Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 18:18:12 +0200
Subject: [PATCH 6/9] Updated libraries, renamed internal methods

---
 .../LendingPoolAddressesProvider.sol          |   6 +-
 .../LendingPoolAddressesProviderRegistry.sol  |   4 +-
 .../flashloan/base/FlashLoanReceiverBase.sol  |   6 +-
 .../DefaultReserveInterestRateStrategy.sol    |   4 +-
 contracts/lendingpool/LendingPool.sol         |  10 +-
 contracts/libraries/logic/ReserveLogic.sol    |  18 +-
 contracts/libraries/logic/ValidationLogic.sol | 238 +++++++++---------
 contracts/libraries/math/MathUtils.sol        |  20 +-
 contracts/libraries/math/PercentageMath.sol   |  22 +-
 .../InitializableAdminUpgradeabilityProxy.sol |  16 +-
 .../mocks/flashloan/MockFlashLoanReceiver.sol |   2 +-
 contracts/tokenization/AToken.sol             |  58 ++---
 12 files changed, 199 insertions(+), 205 deletions(-)

diff --git a/contracts/configuration/LendingPoolAddressesProvider.sol b/contracts/configuration/LendingPoolAddressesProvider.sol
index 916842d9..7d2d3ad9 100644
--- a/contracts/configuration/LendingPoolAddressesProvider.sol
+++ b/contracts/configuration/LendingPoolAddressesProvider.sol
@@ -52,7 +52,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
    * @param pool the new lending pool implementation
    **/
   function setLendingPoolImpl(address pool) external override onlyOwner {
-    updateImplInternal(LENDING_POOL, pool);
+    _updateImpl(LENDING_POOL, pool);
     emit LendingPoolUpdated(pool);
   }
 
@@ -69,7 +69,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
    * @param configurator the new lending pool configurator implementation
    **/
   function setLendingPoolConfiguratorImpl(address configurator) external override onlyOwner {
-    updateImplInternal(LENDING_POOL_CONFIGURATOR, configurator);
+    _updateImpl(LENDING_POOL_CONFIGURATOR, configurator);
     emit LendingPoolConfiguratorUpdated(configurator);
   }
 
@@ -130,7 +130,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
    * @param id the id of the contract to be updated
    * @param newAddress the address of the new implementation
    **/
-  function updateImplInternal(bytes32 id, address newAddress) internal {
+  function _updateImpl(bytes32 id, address newAddress) internal {
     address payable proxyAddress = payable(_addresses[id]);
 
     InitializableAdminUpgradeabilityProxy proxy = InitializableAdminUpgradeabilityProxy(
diff --git a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol
index 4066e14e..02e0bafc 100644
--- a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol
+++ b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol
@@ -56,7 +56,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
    **/
   function registerAddressesProvider(address _provider, uint256 _id) public override onlyOwner {
     addressesProviders[_provider] = _id;
-    addToAddressesProvidersListInternal(_provider);
+    _addToAddressesProvidersList(_provider);
     emit AddressesProviderRegistered(_provider);
   }
 
@@ -74,7 +74,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
    * @dev adds to the list of the addresses providers, if it wasn't already added before
    * @param _provider the pool address to be added
    **/
-  function addToAddressesProvidersListInternal(address _provider) internal {
+  function _addToAddressesProvidersList(address _provider) internal {
     for (uint256 i = 0; i < addressesProvidersList.length; i++) {
       if (addressesProvidersList[i] == _provider) {
         return;
diff --git a/contracts/flashloan/base/FlashLoanReceiverBase.sol b/contracts/flashloan/base/FlashLoanReceiverBase.sol
index d25a3325..530cf980 100644
--- a/contracts/flashloan/base/FlashLoanReceiverBase.sol
+++ b/contracts/flashloan/base/FlashLoanReceiverBase.sol
@@ -20,15 +20,15 @@ abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
 
   receive() external payable {}
 
-  function transferFundsBackInternal(
+  function _transferFundsBack(
     address _reserve,
     address _destination,
     uint256 _amount
   ) internal {
-    transferInternal(_destination, _reserve, _amount);
+    _transfer(_destination, _reserve, _amount);
   }
 
-  function transferInternal(
+  function _transfer(
     address _destination,
     address _reserve,
     uint256 _amount
diff --git a/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol b/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol
index c8c2d946..5059b7eb 100644
--- a/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol
+++ b/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol
@@ -149,7 +149,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
       );
     }
 
-    currentLiquidityRate = getOverallBorrowRateInternal(
+    currentLiquidityRate = _getOverallBorrowRate(
       totalBorrowsStable,
       totalBorrowsVariable,
       currentVariableBorrowRate,
@@ -170,7 +170,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
    * @param currentAverageStableBorrowRate the weighted average of all the stable rate borrows
    * @return the weighted averaged borrow rate
    **/
-  function getOverallBorrowRateInternal(
+  function _getOverallBorrowRate(
     uint256 totalBorrowsStable,
     uint256 totalBorrowsVariable,
     uint256 currentVariableBorrowRate,
diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol
index 78665daa..e4520e56 100644
--- a/contracts/lendingpool/LendingPool.sol
+++ b/contracts/lendingpool/LendingPool.sol
@@ -377,11 +377,11 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable, ILendingPool {
     (uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebt(_onBehalfOf, reserve);
 
     ReserveLogic.InterestRateMode rateMode = ReserveLogic.InterestRateMode(_rateMode);
-
+    
     //default to max amount
     uint256 paybackAmount = rateMode == ReserveLogic.InterestRateMode.STABLE
-      ? stableDebt
-      : variableDebt;
+      ? IERC20(reserve.stableDebtTokenAddress).balanceOf(_onBehalfOf)
+      : IERC20(reserve.variableDebtTokenAddress).balanceOf(_onBehalfOf);
 
     if (amount != UINT_MAX_VALUE && amount < paybackAmount) {
       paybackAmount = amount;
@@ -389,13 +389,11 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable, ILendingPool {
 
     ValidationLogic.validateRepay(
       reserve,
-      asset,
       amount,
       rateMode,
       _onBehalfOf,
       stableDebt,
-      variableDebt,
-      paybackAmount
+      variableDebt
     );
 
     reserve.updateCumulativeIndexesAndTimestamp();
diff --git a/contracts/libraries/logic/ReserveLogic.sol b/contracts/libraries/logic/ReserveLogic.sol
index 867ecd22..6aab6932 100644
--- a/contracts/libraries/logic/ReserveLogic.sol
+++ b/contracts/libraries/logic/ReserveLogic.sol
@@ -178,8 +178,8 @@ library ReserveLogic {
   function init(
     ReserveData storage reserve,
     address aTokenAddress,
-    address _stableDebtAddress,
-    address _variableDebtAddress,
+    address stableDebtTokenAddress,
+    address variableDebtTokenAddress,
     address interestRateStrategyAddress
   ) external {
     require(reserve.aTokenAddress == address(0), 'Reserve has already been initialized');
@@ -193,8 +193,8 @@ library ReserveLogic {
     }
 
     reserve.aTokenAddress = aTokenAddress;
-    reserve.stableDebtTokenAddress = _stableDebtAddress;
-    reserve.variableDebtTokenAddress = _variableDebtAddress;
+    reserve.stableDebtTokenAddress = stableDebtTokenAddress;
+    reserve.variableDebtTokenAddress = variableDebtTokenAddress;
     reserve.interestRateStrategyAddress = interestRateStrategyAddress;
   }
 
@@ -202,14 +202,14 @@ library ReserveLogic {
    * @dev Updates the reserve current stable borrow rate Rf, the current variable borrow rate Rv and the current liquidity rate Rl.
    * Also updates the lastUpdateTimestamp value. Please refer to the whitepaper for further information.
    * @param reserve the address of the reserve to be updated
-   * @param _liquidityAdded the amount of liquidity added to the protocol (deposit or repay) in the previous action
-   * @param _liquidityTaken the amount of liquidity taken from the protocol (redeem or borrow)
+   * @param liquidityAdded the amount of liquidity added to the protocol (deposit or repay) in the previous action
+   * @param liquidityTaken the amount of liquidity taken from the protocol (redeem or borrow)
    **/
   function updateInterestRates(
     ReserveData storage reserve,
     address reserveAddress,
-    uint256 _liquidityAdded,
-    uint256 _liquidityTaken
+    uint256 liquidityAdded,
+    uint256 liquidityTaken
   ) internal {
     uint256 currentAvgStableRate = IStableDebtToken(reserve.stableDebtTokenAddress)
       .getAverageStableRate();
@@ -222,7 +222,7 @@ library ReserveLogic {
       uint256 newVariableRate
     ) = IReserveInterestRateStrategy(reserve.interestRateStrategyAddress).calculateInterestRates(
       reserveAddress,
-      balance.add(_liquidityAdded).sub(_liquidityTaken),
+      balance.add(liquidityAdded).sub(liquidityTaken),
       IERC20(reserve.stableDebtTokenAddress).totalSupply(),
       IERC20(reserve.variableDebtTokenAddress).totalSupply(),
       currentAvgStableRate
diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol
index 5d55a32a..b7b16ddd 100644
--- a/contracts/libraries/logic/ValidationLogic.sol
+++ b/contracts/libraries/logic/ValidationLogic.sol
@@ -29,54 +29,54 @@ library ValidationLogic {
 
   /**
    * @dev validates a deposit.
-   * @param _reserve the reserve state on which the user is depositing
-   * @param _amount the amount to be deposited
+   * @param reserve the reserve state on which the user is depositing
+   * @param amount the amount to be deposited
    */
-  function validateDeposit(ReserveLogic.ReserveData storage _reserve, uint256 _amount)
+  function validateDeposit(ReserveLogic.ReserveData storage reserve, uint256 amount)
     internal
     view
   {
-    (bool isActive, bool isFreezed, , ) = _reserve.configuration.getFlags();
+    (bool isActive, bool isFreezed, , ) = reserve.configuration.getFlags();
 
-    require(_amount > 0, 'Amount must be greater than 0');
+    require(amount > 0, 'Amount must be greater than 0');
     require(isActive, 'Action requires an active reserve');
     require(!isFreezed, 'Action requires an unfreezed reserve');
   }
 
   /**
    * @dev validates a withdraw action.
-   * @param _reserveAddress the address of the reserve
-   * @param _aTokenAddress the address of the aToken for the reserve
-   * @param _amount the amount to be withdrawn
-   * @param _userBalance the balance of the user
+   * @param reserveAddress the address of the reserve
+   * @param aTokenAddress the address of the aToken for the reserve
+   * @param amount the amount to be withdrawn
+   * @param userBalance the balance of the user
    */
   function validateWithdraw(
-    address _reserveAddress,
-    address _aTokenAddress,
-    uint256 _amount,
-    uint256 _userBalance,
-    mapping(address => ReserveLogic.ReserveData) storage _reservesData,
-    UserConfiguration.Map storage _userConfig,
-    address[] calldata _reserves,
-    address _oracle
+    address reserveAddress,
+    address aTokenAddress,
+    uint256 amount,
+    uint256 userBalance,
+    mapping(address => ReserveLogic.ReserveData) storage reservesData,
+    UserConfiguration.Map storage userConfig,
+    address[] calldata reserves,
+    address oracle
   ) external view {
-    require(_amount > 0, 'Amount must be greater than 0');
+    require(amount > 0, 'Amount must be greater than 0');
 
-    uint256 currentAvailableLiquidity = IERC20(_reserveAddress).balanceOf(address(_aTokenAddress));
+    uint256 currentAvailableLiquidity = IERC20(reserveAddress).balanceOf(address(aTokenAddress));
 
-    require(currentAvailableLiquidity >= _amount, '4');
+    require(currentAvailableLiquidity >= amount, '4');
 
-    require(_amount <= _userBalance, 'User cannot withdraw more than the available balance');
+    require(amount <= userBalance, 'User cannot withdraw more than the available balance');
 
     require(
       GenericLogic.balanceDecreaseAllowed(
-        _reserveAddress,
+        reserveAddress,
         msg.sender,
-        _userBalance,
-        _reservesData,
-        _userConfig,
-        _reserves,
-        _oracle
+        userBalance,
+        reservesData,
+        userConfig,
+        reserves,
+        oracle
       ),
       'Transfer cannot be allowed.'
     );
@@ -105,29 +105,29 @@ library ValidationLogic {
 
   /**
    * @dev validates a borrow.
-   * @param _reserve the reserve state from which the user is borrowing
-   * @param _reserveAddress the address of the reserve
-   * @param _amount the amount to be borrowed
-   * @param _amountInETH the amount to be borrowed, in ETH
-   * @param _interestRateMode the interest rate mode at which the user is borrowing
-   * @param _maxStableLoanPercent the max amount of the liquidity that can be borrowed at stable rate, in percentage
-   * @param _reservesData the state of all the reserves
-   * @param _userConfig the state of the user for the specific reserve
-   * @param _reserves the addresses of all the active reserves
-   * @param _oracle the price oracle
+   * @param reserve the reserve state from which the user is borrowing
+   * @param reserveAddress the address of the reserve
+   * @param amount the amount to be borrowed
+   * @param amountInETH the amount to be borrowed, in ETH
+   * @param interestRateMode the interest rate mode at which the user is borrowing
+   * @param maxStableLoanPercent the max amount of the liquidity that can be borrowed at stable rate, in percentage
+   * @param reservesData the state of all the reserves
+   * @param userConfig the state of the user for the specific reserve
+   * @param reserves the addresses of all the active reserves
+   * @param oracle the price oracle
    */
 
   function validateBorrow(
-    ReserveLogic.ReserveData storage _reserve,
-    address _reserveAddress,
-    uint256 _amount,
-    uint256 _amountInETH,
-    uint256 _interestRateMode,
-    uint256 _maxStableLoanPercent,
-    mapping(address => ReserveLogic.ReserveData) storage _reservesData,
-    UserConfiguration.Map storage _userConfig,
-    address[] calldata _reserves,
-    address _oracle
+    ReserveLogic.ReserveData storage reserve,
+    address reserveAddress,
+    uint256 amount,
+    uint256 amountInETH,
+    uint256 interestRateMode,
+    uint256 maxStableLoanPercent,
+    mapping(address => ReserveLogic.ReserveData) storage reservesData,
+    UserConfiguration.Map storage userConfig,
+    address[] calldata reserves,
+    address oracle
   ) external view {
     ValidateBorrowLocalVars memory vars;
 
@@ -136,7 +136,7 @@ library ValidationLogic {
       vars.isFreezed,
       vars.borrowingEnabled,
       vars.stableRateBorrowingEnabled
-    ) = _reserve.configuration.getFlags();
+    ) = reserve.configuration.getFlags();
 
     require(vars.isActive, 'Action requires an active reserve');
     require(!vars.isFreezed, 'Action requires an unfreezed reserve');
@@ -145,15 +145,15 @@ library ValidationLogic {
 
     //validate interest rate mode
     require(
-      uint256(ReserveLogic.InterestRateMode.VARIABLE) == _interestRateMode ||
-        uint256(ReserveLogic.InterestRateMode.STABLE) == _interestRateMode,
+      uint256(ReserveLogic.InterestRateMode.VARIABLE) == interestRateMode ||
+        uint256(ReserveLogic.InterestRateMode.STABLE) == interestRateMode,
       'Invalid interest rate mode selected'
     );
 
     //check that the amount is available in the reserve
-    vars.availableLiquidity = IERC20(_reserveAddress).balanceOf(address(_reserve.aTokenAddress));
+    vars.availableLiquidity = IERC20(reserveAddress).balanceOf(address(reserve.aTokenAddress));
 
-    require(vars.availableLiquidity >= _amount, '7');
+    require(vars.availableLiquidity >= amount, '7');
 
     (
       vars.userCollateralBalanceETH,
@@ -163,10 +163,10 @@ library ValidationLogic {
       vars.healthFactor
     ) = GenericLogic.calculateUserAccountData(
       msg.sender,
-      _reservesData,
-      _userConfig,
-      _reserves,
-      _oracle
+      reservesData,
+      userConfig,
+      reserves,
+      oracle
     );
 
     require(vars.userCollateralBalanceETH > 0, 'The collateral balance is 0');
@@ -174,7 +174,7 @@ library ValidationLogic {
     require(vars.healthFactor > GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD, '8');
 
     //add the current already borrowed amount to the amount requested to calculate the total collateral needed.
-    vars.amountOfCollateralNeededETH = vars.userBorrowBalanceETH.add(_amountInETH).percentDiv(
+    vars.amountOfCollateralNeededETH = vars.userBorrowBalanceETH.add(amountInETH).percentDiv(
       vars.currentLtv
     ); //LTV is calculated in percentage
 
@@ -198,88 +198,84 @@ library ValidationLogic {
       require(vars.stableRateBorrowingEnabled, '11');
 
       require(
-        !_userConfig.isUsingAsCollateral(_reserve.index) ||
-          _reserve.configuration.getLtv() == 0 ||
-          _amount > IERC20(_reserve.aTokenAddress).balanceOf(msg.sender),
+        !userConfig.isUsingAsCollateral(reserve.index) ||
+          reserve.configuration.getLtv() == 0 ||
+          amount > IERC20(reserve.aTokenAddress).balanceOf(msg.sender),
         '12'
       );
 
       //calculate the max available loan size in stable rate mode as a percentage of the
       //available liquidity
-      uint256 maxLoanSizeStable = vars.availableLiquidity.percentMul(_maxStableLoanPercent);
+      uint256 maxLoanSizeStable = vars.availableLiquidity.percentMul(maxStableLoanPercent);
 
-      require(_amount <= maxLoanSizeStable, '13');
+      require(amount <= maxLoanSizeStable, '13');
     }
   }
 
   /**
    * @dev validates a repay.
-   * @param _reserve the reserve state from which the user is repaying
-   * @param _reserveAddress the address of the reserve
-   * @param _amountSent the amount sent for the repayment. Can be an actual value or uint(-1)
-   * @param _onBehalfOf the address of the user msg.sender is repaying for
-   * @param _stableBorrowBalance the borrow balance of the user
-   * @param _variableBorrowBalance the borrow balance of the user
-   * @param _actualPaybackAmount the actual amount being repaid
+   * @param reserve the reserve state from which the user is repaying
+   * @param amountSent the amount sent for the repayment. Can be an actual value or uint(-1)
+   * @param onBehalfOf the address of the user msg.sender is repaying for
+   * @param stableBorrowBalance the borrow balance of the user
+   * @param variableBorrowBalance the borrow balance of the user
    */
   function validateRepay(
-    ReserveLogic.ReserveData storage _reserve,
-    address _reserveAddress,
-    uint256 _amountSent,
-    ReserveLogic.InterestRateMode _rateMode,
-    address _onBehalfOf,
-    uint256 _stableBorrowBalance,
-    uint256 _variableBorrowBalance,
-    uint256 _actualPaybackAmount
+    ReserveLogic.ReserveData storage reserve,
+    uint256 amountSent,
+    ReserveLogic.InterestRateMode rateMode,
+    address onBehalfOf,
+    uint256 stableBorrowBalance,
+    uint256 variableBorrowBalance
   ) external view {
-    bool isActive = _reserve.configuration.getActive();
+    bool isActive = reserve.configuration.getActive();
 
     require(isActive, 'Action requires an active reserve');
 
-    require(_amountSent > 0, 'Amount must be greater than 0');
+    require(amountSent > 0, 'Amount must be greater than 0');
 
     require(
-      (_stableBorrowBalance > 0 &&
-        ReserveLogic.InterestRateMode(_rateMode) == ReserveLogic.InterestRateMode.STABLE) ||
-        (_variableBorrowBalance > 0 &&
-          ReserveLogic.InterestRateMode(_rateMode) == ReserveLogic.InterestRateMode.VARIABLE),
+      (stableBorrowBalance > 0 &&
+        ReserveLogic.InterestRateMode(rateMode) == ReserveLogic.InterestRateMode.STABLE) ||
+        (variableBorrowBalance > 0 &&
+          ReserveLogic.InterestRateMode(rateMode) == ReserveLogic.InterestRateMode.VARIABLE),
       '16'
     );
 
     require(
-      _amountSent != uint256(-1) || msg.sender == _onBehalfOf,
+      amountSent != uint256(-1) || msg.sender == onBehalfOf,
       'To repay on behalf of an user an explicit amount to repay is needed'
     );
   }
 
   /**
    * @dev validates a swap of borrow rate mode.
-   * @param _reserve the reserve state on which the user is swapping the rate
-   * @param _userConfig the user reserves configuration
-   * @param _stableBorrowBalance the stable borrow balance of the user
-   * @param _variableBorrowBalance the stable borrow balance of the user
-   * @param _currentRateMode the rate mode of the borrow
+   * @param reserve the reserve state on which the user is swapping the rate
+   * @param userConfig the user reserves configuration
+   * @param stableBorrowBalance the stable borrow balance of the user
+   * @param variableBorrowBalance the stable borrow balance of the user
+   * @param currentRateMode the rate mode of the borrow
    */
   function validateSwapRateMode(
-    ReserveLogic.ReserveData storage _reserve,
-    UserConfiguration.Map storage _userConfig,
-    uint256 _stableBorrowBalance,
-    uint256 _variableBorrowBalance,
-    ReserveLogic.InterestRateMode _currentRateMode
+    ReserveLogic.ReserveData storage reserve,
+    UserConfiguration.Map storage userConfig,
+    uint256 stableBorrowBalance,
+    uint256 variableBorrowBalance,
+    ReserveLogic.InterestRateMode currentRateMode
   ) external view {
-    (bool isActive, bool isFreezed, , bool stableRateEnabled) = _reserve.configuration.getFlags();
+    (bool isActive, bool isFreezed, , bool stableRateEnabled) = reserve.configuration.getFlags();
 
     require(isActive, 'Action requires an active reserve');
     require(!isFreezed, 'Action requires an unfreezed reserve');
 
-    if (_currentRateMode == ReserveLogic.InterestRateMode.STABLE) {
+    if (currentRateMode == ReserveLogic.InterestRateMode.STABLE) {
       require(
-        _stableBorrowBalance > 0,
+        stableBorrowBalance > 0,
         'User does not have a stable rate loan in progress on this reserve'
       );
-    } else if (_currentRateMode == ReserveLogic.InterestRateMode.VARIABLE) {
+    } else if (currentRateMode == ReserveLogic.InterestRateMode.VARIABLE) {
       require(
-        _variableBorrowBalance > 0,
+        variableBorrowBalance > 0,
         'User does not have a variable rate loan in progress on this reserve'
       );
       /**
@@ -292,10 +288,10 @@ library ValidationLogic {
       require(stableRateEnabled, '11');
 
       require(
-        !_userConfig.isUsingAsCollateral(_reserve.index) ||
-          _reserve.configuration.getLtv() == 0 ||
-          _stableBorrowBalance.add(_variableBorrowBalance) >
-          IERC20(_reserve.aTokenAddress).balanceOf(msg.sender),
+        !userConfig.isUsingAsCollateral(reserve.index) ||
+          reserve.configuration.getLtv() == 0 ||
+          stableBorrowBalance.add(variableBorrowBalance) >
+          IERC20(reserve.aTokenAddress).balanceOf(msg.sender),
         '12'
       );
     } else {
@@ -305,34 +301,34 @@ library ValidationLogic {
 
   /**
    * @dev validates the choice of a user of setting (or not) an asset as collateral
-   * @param _reserve the state of the reserve that the user is enabling or disabling as collateral
-   * @param _reserveAddress the address of the reserve
-   * @param _reservesData the data of all the reserves
-   * @param _userConfig the state of the user for the specific reserve
-   * @param _reserves the addresses of all the active reserves
-   * @param _oracle the price oracle
+   * @param reserve the state of the reserve that the user is enabling or disabling as collateral
+   * @param reserveAddress the address of the reserve
+   * @param reservesData the data of all the reserves
+   * @param userConfig the state of the user for the specific reserve
+   * @param reserves the addresses of all the active reserves
+   * @param oracle the price oracle
    */
   function validateSetUseReserveAsCollateral(
-    ReserveLogic.ReserveData storage _reserve,
-    address _reserveAddress,
-    mapping(address => ReserveLogic.ReserveData) storage _reservesData,
-    UserConfiguration.Map storage _userConfig,
-    address[] calldata _reserves,
-    address _oracle
+    ReserveLogic.ReserveData storage reserve,
+    address reserveAddress,
+    mapping(address => ReserveLogic.ReserveData) storage reservesData,
+    UserConfiguration.Map storage userConfig,
+    address[] calldata reserves,
+    address oracle
   ) external view {
-    uint256 underlyingBalance = IERC20(_reserve.aTokenAddress).balanceOf(msg.sender);
+    uint256 underlyingBalance = IERC20(reserve.aTokenAddress).balanceOf(msg.sender);
 
     require(underlyingBalance > 0, '22');
 
     require(
       GenericLogic.balanceDecreaseAllowed(
-        _reserveAddress,
+        reserveAddress,
         msg.sender,
         underlyingBalance,
-        _reservesData,
-        _userConfig,
-        _reserves,
-        _oracle
+        reservesData,
+        userConfig,
+        reserves,
+        oracle
       ),
       'User deposit is already being used as collateral'
     );
diff --git a/contracts/libraries/math/MathUtils.sol b/contracts/libraries/math/MathUtils.sol
index e8d1dcbe..fd6b1c0c 100644
--- a/contracts/libraries/math/MathUtils.sol
+++ b/contracts/libraries/math/MathUtils.sol
@@ -12,22 +12,22 @@ library MathUtils {
 
   /**
    * @dev function to calculate the interest using a linear interest rate formula
-   * @param _rate the interest rate, in ray
-   * @param _lastUpdateTimestamp the timestamp of the last update of the interest
+   * @param rate the interest rate, in ray
+   * @param lastUpdateTimestamp the timestamp of the last update of the interest
    * @return the interest rate linearly accumulated during the timeDelta, in ray
    **/
 
-  function calculateLinearInterest(uint256 _rate, uint40 _lastUpdateTimestamp)
+  function calculateLinearInterest(uint256 rate, uint40 lastUpdateTimestamp)
     internal
     view
     returns (uint256)
   {
     //solium-disable-next-line
-    uint256 timeDifference = block.timestamp.sub(uint256(_lastUpdateTimestamp));
+    uint256 timeDifference = block.timestamp.sub(uint256(lastUpdateTimestamp));
 
     uint256 timeDelta = timeDifference.wadToRay().rayDiv(SECONDS_PER_YEAR.wadToRay());
 
-    return _rate.rayMul(timeDelta).add(WadRayMath.ray());
+    return rate.rayMul(timeDelta).add(WadRayMath.ray());
   }
 
   /**
@@ -39,17 +39,17 @@ library MathUtils {
    * The approximation slightly underpays liquidity providers, with the advantage of great gas cost reductions.
    * The whitepaper contains reference to the approximation and a table showing the margin of error per different time periods.
    *
-   * @param _rate the interest rate, in ray
-   * @param _lastUpdateTimestamp the timestamp of the last update of the interest
+   * @param rate the interest rate, in ray
+   * @param lastUpdateTimestamp the timestamp of the last update of the interest
    * @return the interest rate compounded during the timeDelta, in ray
    **/
-  function calculateCompoundedInterest(uint256 _rate, uint40 _lastUpdateTimestamp)
+  function calculateCompoundedInterest(uint256 rate, uint40 lastUpdateTimestamp)
     internal
     view
     returns (uint256)
   {
     //solium-disable-next-line
-    uint256 exp = block.timestamp.sub(uint256(_lastUpdateTimestamp));
+    uint256 exp = block.timestamp.sub(uint256(lastUpdateTimestamp));
 
     if (exp == 0) {
       return WadRayMath.ray();
@@ -59,7 +59,7 @@ library MathUtils {
 
     uint256 expMinusTwo = exp > 2 ? exp.sub(2) : 0;
 
-    uint256 ratePerSecond = _rate.div(31536000);
+    uint256 ratePerSecond = rate.div(31536000);
 
     uint256 basePowerTwo = ratePerSecond.rayMul(ratePerSecond);
     uint256 basePowerThree = basePowerTwo.rayMul(ratePerSecond);
diff --git a/contracts/libraries/math/PercentageMath.sol b/contracts/libraries/math/PercentageMath.sol
index 846fb518..dfb6c005 100644
--- a/contracts/libraries/math/PercentageMath.sol
+++ b/contracts/libraries/math/PercentageMath.sol
@@ -19,23 +19,23 @@ library PercentageMath {
 
   /**
    * @dev executes a percentage multiplication
-   * @param _value the value of which the percentage needs to be calculated
-   * @param _percentage the percentage of the value to be calculated
-   * @return the _percentage of _value
+   * @param value the value of which the percentage needs to be calculated
+   * @param percentage the percentage of the value to be calculated
+   * @return the percentage of value
    **/
-  function percentMul(uint256 _value, uint256 _percentage) internal pure returns (uint256) {
-    return HALF_PERCENT.add(_value.mul(_percentage)).div(PERCENTAGE_FACTOR);
+  function percentMul(uint256 value, uint256 percentage) internal pure returns (uint256) {
+    return HALF_PERCENT.add(value.mul(percentage)).div(PERCENTAGE_FACTOR);
   }
 
   /**
    * @dev executes a percentage division
-   * @param _value the value of which the percentage needs to be calculated
-   * @param _percentage the percentage of the value to be calculated
-   * @return the _value divided the _percentage
+   * @param value the value of which the percentage needs to be calculated
+   * @param percentage the percentage of the value to be calculated
+   * @return the value divided the percentage
    **/
-  function percentDiv(uint256 _value, uint256 _percentage) internal pure returns (uint256) {
-    uint256 halfPercentage = _percentage / 2;
+  function percentDiv(uint256 value, uint256 percentage) internal pure returns (uint256) {
+    uint256 halfPercentage = percentage / 2;
 
-    return halfPercentage.add(_value.mul(PERCENTAGE_FACTOR)).div(_percentage);
+    return halfPercentage.add(value.mul(PERCENTAGE_FACTOR)).div(percentage);
   }
 }
diff --git a/contracts/libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol b/contracts/libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol
index 05bad139..2643b4af 100644
--- a/contracts/libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol
+++ b/contracts/libraries/openzeppelin-upgradeability/InitializableAdminUpgradeabilityProxy.sol
@@ -15,22 +15,22 @@ contract InitializableAdminUpgradeabilityProxy is
 {
   /**
    * Contract initializer.
-   * @param _logic address of the initial implementation.
-   * @param _admin Address of the proxy administrator.
-   * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
+   * @param logic address of the initial implementation.
+   * @param admin Address of the proxy administrator.
+   * @param data Data to send as msg.data to the implementation to initialize the proxied contract.
    * It should include the signature and the parameters of the function to be called, as described in
    * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
    * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
    */
   function initialize(
-    address _logic,
-    address _admin,
-    bytes memory _data
+    address logic,
+    address admin,
+    bytes memory data
   ) public payable {
     require(_implementation() == address(0));
-    InitializableUpgradeabilityProxy.initialize(_logic, _data);
+    InitializableUpgradeabilityProxy.initialize(logic, data);
     assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
-    _setAdmin(_admin);
+    _setAdmin(admin);
   }
 
   /**
diff --git a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol
index 1c6657a9..b1bfc8b2 100644
--- a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol
+++ b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol
@@ -51,7 +51,7 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase {
     token.mint(_fee);
 
     //returning amount + fee to the destination
-    transferFundsBackInternal(_reserve, _destination, _amount.add(_fee));
+    _transferFundsBack(_reserve, _destination, _amount.add(_fee));
 
     emit ExecutedWithSuccess(_reserve, _amount, _fee);
   }
diff --git a/contracts/tokenization/AToken.sol b/contracts/tokenization/AToken.sol
index ef948d42..bd4a2c79 100644
--- a/contracts/tokenization/AToken.sol
+++ b/contracts/tokenization/AToken.sol
@@ -154,7 +154,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     address to,
     uint256 amount
   ) internal override whenTransferAllowed(from, amount) {
-    executeTransferInternal(from, to, amount);
+    _executeTransfer(from, to, amount);
   }
 
   /**
@@ -164,7 +164,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param to the address to which the interest will be redirected
    **/
   function redirectInterestStream(address to) external override {
-    redirectInterestStreamInternal(msg.sender, to);
+    _redirectInterestStream(msg.sender, to);
   }
 
   /**
@@ -180,7 +180,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       msg.sender == _interestRedirectionAllowances[from],
       'Caller is not allowed to redirect the interest of the user'
     );
-    redirectInterestStreamInternal(from, to);
+    _redirectInterestStream(from, to);
   }
 
   /**
@@ -206,12 +206,12 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     uint256 amount
   ) external override onlyLendingPool {
     //cumulates the balance of the user
-    (, uint256 currentBalance, uint256 balanceIncrease) = calculateBalanceIncreaseInternal(user);
+    (, uint256 currentBalance, uint256 balanceIncrease) = _calculateBalanceIncrease(user);
 
     //if the user is redirecting his interest towards someone else,
     //we update the redirected balance of the redirection address by adding the accrued interest,
     //and removing the amount to redeem
-    updateRedirectedBalanceOfRedirectionAddressInternal(user, balanceIncrease, amount);
+    _updateRedirectedBalanceOfRedirectionAddress(user, balanceIncrease, amount);
 
     if (balanceIncrease > amount) {
       _mint(user, balanceIncrease.sub(amount));
@@ -223,7 +223,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
 
     //reset the user data if the remaining balance is 0
     if (currentBalance.sub(amount) == 0) {
-      resetDataOnZeroBalanceInternal(user);
+      _resetDataOnZeroBalance(user);
     } else {
       //updates the user index
       userIndex = _userIndexes[user] = _pool.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS);
@@ -243,7 +243,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    */
   function mint(address user, uint256 amount) external override onlyLendingPool {
     //cumulates the balance of the user
-    (, , uint256 balanceIncrease) = calculateBalanceIncreaseInternal(user);
+    (, , uint256 balanceIncrease) = _calculateBalanceIncrease(user);
 
     //updates the user index
     uint256 index = _userIndexes[user] = _pool.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS);
@@ -251,7 +251,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     //if the user is redirecting his interest towards someone else,
     //we update the redirected balance of the redirection address by adding the accrued interest
     //and the amount deposited
-    updateRedirectedBalanceOfRedirectionAddressInternal(user, balanceIncrease.add(amount), 0);
+    _updateRedirectedBalanceOfRedirectionAddress(user, balanceIncrease.add(amount), 0);
 
     //mint an equivalent amount of tokens to cover the new deposit
     _mint(user, amount.add(balanceIncrease));
@@ -273,7 +273,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
   ) external override onlyLendingPool {
     //being a normal transfer, the Transfer() and BalanceTransfer() are emitted
     //so no need to emit a specific event here
-    executeTransferInternal(from, to, value);
+    _executeTransfer(from, to, value);
   }
 
   /**
@@ -298,7 +298,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       //accruing for himself means that both the principal balance and
       //the redirected balance partecipate in the interest
       return
-        calculateCumulatedBalanceInternal(user, currentPrincipalBalance.add(redirectedBalance)).sub(
+        _calculateCumulatedBalance(user, currentPrincipalBalance.add(redirectedBalance)).sub(
           redirectedBalance
         );
     } else {
@@ -307,7 +307,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       //by the redirected balance is added to the current principal balance.
       return
         currentPrincipalBalance.add(
-          calculateCumulatedBalanceInternal(user, redirectedBalance).sub(redirectedBalance)
+          _calculateCumulatedBalance(user, redirectedBalance).sub(redirectedBalance)
         );
     }
   }
@@ -385,7 +385,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param user the address of the user
    * @return the last user principal balance, the current balance and the balance increase
    **/
-  function calculateBalanceIncreaseInternal(address user)
+  function _calculateBalanceIncrease(address user)
     internal
     view
     returns (
@@ -413,7 +413,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @return the previous principal balance, the new principal balance, the balance increase
    * and the new user index
    **/
-  function cumulateBalanceInternal(address user)
+  function _cumulateBalance(address user)
     internal
     returns (
       uint256,
@@ -426,7 +426,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       uint256 previousBalance,
       uint256 currentBalance,
       uint256 balanceIncrease
-    ) = calculateBalanceIncreaseInternal(user);
+    ) = _calculateBalanceIncrease(user);
 
     _mint(user, balanceIncrease);
 
@@ -443,7 +443,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param balanceToAdd the amount to add to the redirected balance
    * @param balanceToRemove the amount to remove from the redirected balance
    **/
-  function updateRedirectedBalanceOfRedirectionAddressInternal(
+  function _updateRedirectedBalanceOfRedirectionAddress(
     address user,
     uint256 balanceToAdd,
     uint256 balanceToRemove
@@ -455,7 +455,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     }
 
     //compound balances of the redirected address
-    (, , uint256 balanceIncrease, uint256 index) = cumulateBalanceInternal(redirectionAddress);
+    (, , uint256 balanceIncrease, uint256 index) = _cumulateBalance(redirectionAddress);
 
     //updating the redirected balance
     _redirectedBalances[redirectionAddress] = _redirectedBalances[redirectionAddress]
@@ -469,7 +469,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     // if the redirection address is also redirecting the interest, we accumulate his balance
     // and update his chain of redirection
     if (targetOfRedirectionAddress != address(0)) {
-      updateRedirectedBalanceOfRedirectionAddressInternal(redirectionAddress, balanceIncrease, 0);
+      _updateRedirectedBalanceOfRedirectionAddress(redirectionAddress, balanceIncrease, 0);
     }
 
     emit RedirectedBalanceUpdated(
@@ -487,7 +487,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param balance the balance on which the interest is calculated
    * @return the interest rate accrued
    **/
-  function calculateCumulatedBalanceInternal(address user, uint256 balance)
+  function _calculateCumulatedBalance(address user, uint256 balance)
     internal
     view
     returns (uint256)
@@ -507,7 +507,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param to the destination address
    * @param value the amount to transfer
    **/
-  function executeTransferInternal(
+  function _executeTransfer(
     address from,
     address to,
     uint256 value
@@ -520,20 +520,20 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       uint256 fromBalance,
       uint256 fromBalanceIncrease,
       uint256 fromIndex
-    ) = cumulateBalanceInternal(from);
+    ) = _cumulateBalance(from);
 
     //cumulate the balance of the receiver
-    (, , uint256 toBalanceIncrease, uint256 toIndex) = cumulateBalanceInternal(to);
+    (, , uint256 toBalanceIncrease, uint256 toIndex) = _cumulateBalance(to);
 
     //if the sender is redirecting his interest towards someone else,
     //adds to the redirected balance the accrued interest and removes the amount
     //being transferred
-    updateRedirectedBalanceOfRedirectionAddressInternal(from, fromBalanceIncrease, value);
+    _updateRedirectedBalanceOfRedirectionAddress(from, fromBalanceIncrease, value);
 
     //if the receiver is redirecting his interest towards someone else,
     //adds to the redirected balance the accrued interest and the amount
     //being transferred
-    updateRedirectedBalanceOfRedirectionAddressInternal(to, toBalanceIncrease.add(value), 0);
+    _updateRedirectedBalanceOfRedirectionAddress(to, toBalanceIncrease.add(value), 0);
 
     //performs the transfer
     super._transfer(from, to, value);
@@ -541,7 +541,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     bool fromIndexReset = false;
     //reset the user data if the remaining balance is 0
     if (fromBalance.sub(value) == 0 && from != to) {
-      fromIndexReset = resetDataOnZeroBalanceInternal(from);
+      fromIndexReset = _resetDataOnZeroBalance(from);
     }
 
     emit BalanceTransfer(
@@ -561,7 +561,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param from the address from which transfer the aTokens
    * @param to the destination address
    **/
-  function redirectInterestStreamInternal(address from, address to) internal {
+  function _redirectInterestStream(address from, address to) internal {
     address currentRedirectionAddress = _interestRedirectionAddresses[from];
 
     require(to != currentRedirectionAddress, 'Interest is already redirected to the user');
@@ -572,7 +572,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
       uint256 fromBalance,
       uint256 balanceIncrease,
       uint256 fromIndex
-    ) = cumulateBalanceInternal(from);
+    ) = _cumulateBalance(from);
 
     require(fromBalance > 0, 'Interest stream can only be redirected if there is a valid balance');
 
@@ -580,7 +580,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     //the redirection address we substract the redirected balance of the previous
     //recipient
     if (currentRedirectionAddress != address(0)) {
-      updateRedirectedBalanceOfRedirectionAddressInternal(from, 0, previousPrincipalBalance);
+      _updateRedirectedBalanceOfRedirectionAddress(from, 0, previousPrincipalBalance);
     }
 
     //if the user is redirecting the interest back to himself,
@@ -595,7 +595,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
     _interestRedirectionAddresses[from] = to;
 
     //adds the user balance to the redirected balance of the destination
-    updateRedirectedBalanceOfRedirectionAddressInternal(from, fromBalance, 0);
+    _updateRedirectedBalanceOfRedirectionAddress(from, fromBalance, 0);
 
     emit InterestStreamRedirected(from, to, fromBalance, balanceIncrease, fromIndex);
   }
@@ -606,7 +606,7 @@ contract AToken is VersionedInitializable, ERC20, IAToken {
    * @param user the address of the user
    * @return true if the user index has also been reset, false otherwise. useful to emit the proper user index value
    **/
-  function resetDataOnZeroBalanceInternal(address user) internal returns (bool) {
+  function _resetDataOnZeroBalance(address user) internal returns (bool) {
     //if the user has 0 principal balance, the interest stream redirection gets reset
     _interestRedirectionAddresses[user] = address(0);
 

From 2ce03614a1d9c1d42aed3c3b3512f6a2ffc8e7a9 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 18:28:11 +0200
Subject: [PATCH 7/9] Deleted log files

---
 tests.log |    0
 tsts.log  | 2638 -----------------------------------------------------
 2 files changed, 2638 deletions(-)
 delete mode 100644 tests.log
 delete mode 100644 tsts.log

diff --git a/tests.log b/tests.log
deleted file mode 100644
index e69de29b..00000000
diff --git a/tsts.log b/tsts.log
deleted file mode 100644
index f324f568..00000000
--- a/tsts.log
+++ /dev/null
@@ -1,2638 +0,0 @@
-All contracts have already been compiled, skipping compilation.
-
--> Deploying test environment...
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xb586d7783b4f19aca0817f2817d4d524c88a3b82eddb822789753d1569448533
-contract address: 0xD5A0587aAEB195028909E98930B391dFB3f9F589
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** DAI ***
-
-Network: localhost
-tx: 0xb586d7783b4f19aca0817f2817d4d524c88a3b82eddb822789753d1569448533
-contract address: 0xD5A0587aAEB195028909E98930B391dFB3f9F589
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x17f1ad3a71bff8ddb086b3a29e0eab189798c7d35ac26ca1fd3cc4f739d0d4b9
-contract address: 0xaD3AdbC18E4AD090034A6C74Eda61f4310dce313
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** LEND ***
-
-Network: localhost
-tx: 0x17f1ad3a71bff8ddb086b3a29e0eab189798c7d35ac26ca1fd3cc4f739d0d4b9
-contract address: 0xaD3AdbC18E4AD090034A6C74Eda61f4310dce313
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xca99910956648226bd377089f602824bd5f64b05c43fda0453c2b11fde138e8b
-contract address: 0x25a88BbA9c8D2a46e3Ff4bFe98712DF7A1044fB6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** TUSD ***
-
-Network: localhost
-tx: 0xca99910956648226bd377089f602824bd5f64b05c43fda0453c2b11fde138e8b
-contract address: 0x25a88BbA9c8D2a46e3Ff4bFe98712DF7A1044fB6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x7654a1b1e5c6f396c168a71db5a9aff5706f8f5769a9139aafeee636132dcda8
-contract address: 0x16d1802cd7cfcb67955BBBa26bAae1cE559B5F5B
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** BAT ***
-
-Network: localhost
-tx: 0x7654a1b1e5c6f396c168a71db5a9aff5706f8f5769a9139aafeee636132dcda8
-contract address: 0x16d1802cd7cfcb67955BBBa26bAae1cE559B5F5B
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xf0572fc05c6b6a1c492d3a01656d4bf4cfae18cf36eb2445e900f87f2bc62585
-contract address: 0xE58d8c88f5A670f16BE8F7864707170F43e943A6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** USDC ***
-
-Network: localhost
-tx: 0xf0572fc05c6b6a1c492d3a01656d4bf4cfae18cf36eb2445e900f87f2bc62585
-contract address: 0xE58d8c88f5A670f16BE8F7864707170F43e943A6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x0ed01d58842adba8e7d0225f32861c619ef0d63f82b76a661dcdef8259312ff5
-contract address: 0xfdAF4f6e47e854c05bE158993d32872e784F0502
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** USDT ***
-
-Network: localhost
-tx: 0x0ed01d58842adba8e7d0225f32861c619ef0d63f82b76a661dcdef8259312ff5
-contract address: 0xfdAF4f6e47e854c05bE158993d32872e784F0502
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xddb5f1909ea97c0cb2fbbd04e60e6a97533911b033dae68e13e498172be3f88a
-contract address: 0x92edC13A10036A3C50396f2B63148a3e9a8D589e
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** SUSD ***
-
-Network: localhost
-tx: 0xddb5f1909ea97c0cb2fbbd04e60e6a97533911b033dae68e13e498172be3f88a
-contract address: 0x92edC13A10036A3C50396f2B63148a3e9a8D589e
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xeb716a2750602d4ba8db1c4efee18b5323b3fcd9bb1a2267cfdd14c552630d9d
-contract address: 0xE5C277cDb7E10372918Ac54Ce54022910A24FE88
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** ZRX ***
-
-Network: localhost
-tx: 0xeb716a2750602d4ba8db1c4efee18b5323b3fcd9bb1a2267cfdd14c552630d9d
-contract address: 0xE5C277cDb7E10372918Ac54Ce54022910A24FE88
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x2e6f6babd892cc75a3c2630835fdb41a8ac20b06606d896ba80775c57ce99ec0
-contract address: 0xF5742a599a0F4520089cbf2EBBa66Bb4F471B85F
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MKR ***
-
-Network: localhost
-tx: 0x2e6f6babd892cc75a3c2630835fdb41a8ac20b06606d896ba80775c57ce99ec0
-contract address: 0xF5742a599a0F4520089cbf2EBBa66Bb4F471B85F
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x90484426bb324067dc5b2b4f897390cef832f9875973d66f5c74cc90afe4340b
-contract address: 0x380EF388e13D8cAdeACef6eF682C7B7D85865076
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** WBTC ***
-
-Network: localhost
-tx: 0x90484426bb324067dc5b2b4f897390cef832f9875973d66f5c74cc90afe4340b
-contract address: 0x380EF388e13D8cAdeACef6eF682C7B7D85865076
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x180405090baf7a2cb35b4453f858ebb463aeb383d5574de209ec1ff6c9fc7d72
-contract address: 0xC89577DED8441e52C17C13D527b85b225C5c8311
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** LINK ***
-
-Network: localhost
-tx: 0x180405090baf7a2cb35b4453f858ebb463aeb383d5574de209ec1ff6c9fc7d72
-contract address: 0xC89577DED8441e52C17C13D527b85b225C5c8311
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x0aff12a4e1949b7e88aeeac10c2dbc63126d9784aa26247e9d60938e7ca8a7df
-contract address: 0xD4b06774A717Ff5A7c20c8712e31c6BbfFcb1F01
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** KNC ***
-
-Network: localhost
-tx: 0x0aff12a4e1949b7e88aeeac10c2dbc63126d9784aa26247e9d60938e7ca8a7df
-contract address: 0xD4b06774A717Ff5A7c20c8712e31c6BbfFcb1F01
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0xf94f401499afea0ef833233195ab8b3352061626b4848065309d068f81341795
-contract address: 0xbe66dC9DFEe580ED968403e35dF7b5159f873df8
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MANA ***
-
-Network: localhost
-tx: 0xf94f401499afea0ef833233195ab8b3352061626b4848065309d068f81341795
-contract address: 0xbe66dC9DFEe580ED968403e35dF7b5159f873df8
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x1a455d398c833e8568c2330bd08cd1398d2e327e9bc9912ebc09ef63cac19ae7
-contract address: 0x93AfC6Df4bB8F62F2493B19e577f8382c0BA9EBC
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** REP ***
-
-Network: localhost
-tx: 0x1a455d398c833e8568c2330bd08cd1398d2e327e9bc9912ebc09ef63cac19ae7
-contract address: 0x93AfC6Df4bB8F62F2493B19e577f8382c0BA9EBC
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x5d7ef2fa40a15b6b35a850bb52298cba290dd484dc0c2220bcf6f1c59b71f572
-contract address: 0x75Ded61646B5945BdDd0CD9a9Db7c8288DA6F810
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** SNX ***
-
-Network: localhost
-tx: 0x5d7ef2fa40a15b6b35a850bb52298cba290dd484dc0c2220bcf6f1c59b71f572
-contract address: 0x75Ded61646B5945BdDd0CD9a9Db7c8288DA6F810
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x66323417565315754c3e690c819da610047a75eea1dbff9ace2e4f1b96f722e9
-contract address: 0xdE7c40e675bF1aA45c18cCbaEb9662B16b0Ddf7E
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** BUSD ***
-
-Network: localhost
-tx: 0x66323417565315754c3e690c819da610047a75eea1dbff9ace2e4f1b96f722e9
-contract address: 0xdE7c40e675bF1aA45c18cCbaEb9662B16b0Ddf7E
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770555
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x590cf5ab8151b9c3f791c52537ff1d5350fef57119dade8feaad1dd1a7da7500
-contract address: 0xEcb928A3c079a1696Aa5244779eEc3dE1717fACd
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** USD ***
-
-Network: localhost
-tx: 0x590cf5ab8151b9c3f791c52537ff1d5350fef57119dade8feaad1dd1a7da7500
-contract address: 0xEcb928A3c079a1696Aa5244779eEc3dE1717fACd
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3770435
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x99b8ab1454c11bc7772d5d74d561b3303245172fcebe4fd0bf0eadc7c630d973
-contract address: 0xDFbeeed692AA81E7f86E72F7ACbEA2A1C4d63544
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771395
-
-******
-
-*** UNI_DAI_ETH ***
-
-Network: localhost
-tx: 0x99b8ab1454c11bc7772d5d74d561b3303245172fcebe4fd0bf0eadc7c630d973
-contract address: 0xDFbeeed692AA81E7f86E72F7ACbEA2A1C4d63544
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771395
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x0c2bdc441aa4b7f78ba04c26053aaf04807b8ebd1558e779d0a12cc86fb51fce
-contract address: 0x5191aA68c7dB195181Dd2441dBE23A48EA24b040
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** UNI_USDC_ETH ***
-
-Network: localhost
-tx: 0x0c2bdc441aa4b7f78ba04c26053aaf04807b8ebd1558e779d0a12cc86fb51fce
-contract address: 0x5191aA68c7dB195181Dd2441dBE23A48EA24b040
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x8a093c424df4bfee30b00570abe92496772d8c6510ac37623fe2ff9dba6a8bba
-contract address: 0x8F9422aa37215c8b3D1Ea1674138107F84D68F26
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** UNI_SETH_ETH ***
-
-Network: localhost
-tx: 0x8a093c424df4bfee30b00570abe92496772d8c6510ac37623fe2ff9dba6a8bba
-contract address: 0x8F9422aa37215c8b3D1Ea1674138107F84D68F26
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x94d62111a7ffcdca5888e8ac7eea84ca0977ee44ee7b52517039536446897c80
-contract address: 0xa89E20284Bd638F31b0011D0fC754Fc9d2fa73e3
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** UNI_LINK_ETH ***
-
-Network: localhost
-tx: 0x94d62111a7ffcdca5888e8ac7eea84ca0977ee44ee7b52517039536446897c80
-contract address: 0xa89E20284Bd638F31b0011D0fC754Fc9d2fa73e3
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x4b5d449af171dc55d70923e1d41f0bee93d0d0f371b98cf1072e552e18d041fd
-contract address: 0xaA935993065F2dDB1d13623B1941C7AEE3A60F23
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771395
-
-******
-
-*** UNI_MKR_ETH ***
-
-Network: localhost
-tx: 0x4b5d449af171dc55d70923e1d41f0bee93d0d0f371b98cf1072e552e18d041fd
-contract address: 0xaA935993065F2dDB1d13623B1941C7AEE3A60F23
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771395
-
-******
-
-*** MintableERC20 ***
-
-Network: localhost
-tx: 0x876f15e035bb292b0f73707a18abb5568abb6381084d989e999a05e95de46121
-contract address: 0x35A2624888e207e4B3434E9a9E250bF6Ee68FeA3
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** UNI_LEND_ETH ***
-
-Network: localhost
-tx: 0x876f15e035bb292b0f73707a18abb5568abb6381084d989e999a05e95de46121
-contract address: 0x35A2624888e207e4B3434E9a9E250bF6Ee68FeA3
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 3771515
-
-******
-
-*** LendingPoolAddressesProvider ***
-
-Network: localhost
-tx: 0x3fce8f0464b62f280e1c7b8dd33e27d15b6f716adf04106873adb61bc3bf7a53
-contract address: 0x1f569c307949a908A4b8Ff7453a88Ca0b8D8df13
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 7132975
-
-******
-
-*** LendingPoolAddressesProviderRegistry ***
-
-Network: localhost
-tx: 0xc5f5f7f5f572a0f2b6539cddd35d50bdb340b7a79296efacfd25945ddfa5066c
-contract address: 0x0766c9592a8686CAB0081b4f35449462c6e82F11
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2407480
-
-******
-
-*** FeeProvider ***
-
-Network: localhost
-tx: 0xb1ad34af13934db51b5717e5f1b835dd0d978c21e53aae0bc6009d90203268dd
-contract address: 0x48bb3E35D2D6994374db457a6Bf61de2d9cC8E49
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 1393725
-
-******
-
-Deployed lending pool, address: 0x09F7bF33B3F8922268B34103af3a8AF83148C9B1
-Added pool to addresses provider
-Address is  0x0aA65C476219C5507F920252A84a766fBA750f7d
-implementation set, address: 0x0aA65C476219C5507F920252A84a766fBA750f7d
-*** LendingPoolConfigurator ***
-
-Network: localhost
-tx: 0xb51529c0793a473a3982ba7314edab9d613c4ce83fbad05bd67565aac39ba2aa
-contract address: 0x0Aac5442574A9b15d65fc3DCF536C43a1bB4e512
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** PriceOracle ***
-
-Network: localhost
-tx: 0x2b4e27f785af2d067f0d274568cfbdb016d85a9076bca507e4b8b9b5ec9ae467
-contract address: 0xE0fC5Da76E489677078d00d3f321e9777c76381B
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 767525
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x83fc39840efebce5312a964640fc0036c5b14cc2e1c33d9bea51c2402492f9e5
-contract address: 0x82939Bfa1608CB3Cb4c8E3AF848C195Cc1ea5b63
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524490
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x00d8b37e7bfcfb1f75ed89ad6efd11f98a2227468d95548135bc430fd6307a61
-contract address: 0xBB4BfCbfA82dA2dD614E5bd0454b76de16519d05
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x20235dbccc8ca31f61f05e9c7d34cebfe18a2d762f02c591ef61c3d0f8f69c0a
-contract address: 0x44Bb29434CB04e2Ca36F034A470CA95f64aEbc7E
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x86c571896d74d3a55f74b78f63600835ab3fe16465e0a72c26823306f09c862a
-contract address: 0x8038eE724A0F18bB11634CC78f123047Fa01bc80
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x46de2d0fc1bd0a2708fa5bddb33fc28c66222bbd423ebef46fb956417bce68ce
-contract address: 0xF82a40B63CBCEc5e80d577167B8d3b1DcfE84e5c
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524490
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x60f63168eb72023b798702dafa8aa0d4587eecd410d5e47ed7eaee34753cf88b
-contract address: 0xA6004580E827191150006D4748330F7F57FDB054
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524490
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x01aa9c52bbdb824545c70d1e386fa31b27ae481cbddbbba82870ad89f5ed2a75
-contract address: 0x2B46D647B648Cc432dca68aa0f2Edc08386e7b57
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0xa369e6bdd66fae952bcd4820f55c965b05eab6aae218c0bd716bd9bb79fb936a
-contract address: 0xb207EcaA1771F05A674E7d24A082b2892DDC66bc
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524490
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x12824ebced7299823ea62b962c5bf53866576739114c2828a144165be60f93af
-contract address: 0x2F7e8dCe87DE8d723b897b8220Cf25e1CD2a2Ea6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0xa36cddf6caff448dc0454af5fe33929f88c86d17d54a1e905b1db402e82f7d5e
-contract address: 0xa191baa1E96FeFE2b700C536E245725F09717275
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x40bd33f15fb9d9b7232159422b1570c398c26204faff63588b37e13e3c90aa0b
-contract address: 0xbD51e397Aa5012aa91628f0354f9670805BfA94E
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524550
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x33a21c4f39473824c720f0d956a6f4b35c62077a097f204dbbaed3ff3a6e3cb7
-contract address: 0xFc40e47aFD52bD460D65B06c828E54A13d288CE4
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x1faa932094ef2a5fd7d1d6189f9d2bc45aa19769118a42186e8d99e2d89bc068
-contract address: 0x5795a1e56931bB7Fb8389821f3574983502A785d
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524370
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x4ce6fb9d018f5c1164150e3e99923b870e5af843597329e272f3ce3d6409c960
-contract address: 0x715Ad5d800535dB0d334F9F42e3eC393947996e3
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524370
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x443e96ba770ae00e109d83f9ed6799cc0e0c318e477f13366cde539a4a88dc2b
-contract address: 0xC452C5244F701108B4e8E8BCe693160046b30332
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x1f861433bf8be55232170a5b6eaf1f16e4a335821f4c42b5e79f6eee405bcd15
-contract address: 0x0B63c002cb44B2e5e580C3B3560a27F4101D95c0
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0xbc759930c4b4202686ca6f1597b0c50e529b231ebc1a3f8bf74371d7cd0af3e5
-contract address: 0x3F80d60280cc4AdF3e5891765b5545A6B36ebe57
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x2fbc3e3a032ab919e4ac94274bf1b4a71e6586c14818303941a40dfb05fd24b4
-contract address: 0xCeB290A2C6614BF23B2faa0f0B8067F29C48DB0F
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x4174404dc611a04751bfee2754742a4a5213fdd493614bb289248b7841f4ccc2
-contract address: 0x90ee8009AA6add17A0de8Ee22666a91602fa4adf
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x863e04b0b967fe53e664d9c3cc8617b1fbafd7f36b8922567e02e7c577b2d784
-contract address: 0xc5BeCE9e44E7dE5464f102f6cD4e5b7aBC94B059
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x365c924632506d3c1b3c94b361719a6d9a72aaf2bf16a8a302fa5fa465758e99
-contract address: 0xF63EA31f84CFF5D1Eb4b8C3ca0D9489490fB98d5
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0x0b28e3dc60d77543c41d9140624daf77796467269a4dcbe5533e8301c9444f74
-contract address: 0xD8f534d97D241Fc9EC4A224C90BDD5E3F3990874
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** MockAggregator ***
-
-Network: localhost
-tx: 0xebdfc0702b3e8fa0937922a35084b8ee7ac18ad96670567992fe6d142eec0d31
-contract address: 0xDCAB55FBf59a253B3Fb0CD2Ba45F0c02413dF375
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 524430
-
-******
-
-*** ChainlinkProxyPriceProvider ***
-
-Network: localhost
-tx: 0x252c1220976c612e307ba95546ab521169ec3a2d834e558309a88f097f13d2df
-contract address: 0x293965D84cE150Cbf5F36332ba47e997e2763bf2
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 6220980
-
-******
-
-*** LendingRateOracle ***
-
-Network: localhost
-tx: 0xd1419a6cc75c664b8ca393ec7d9da98b2c43d8405acfc49daa7617248feacfb4
-contract address: 0x7549d6bb05083613eF87b723595553dCc570Ca21
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 1719980
-
-******
-
-Initialize configuration
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x17a7e5dcc03fb1a55300548f547c6a97d682a29576108481f27654a67b64e6e7
-contract address: 0xd5B734c970729Cc6372F7d712C485827d93eD14f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xc82988f9a8e23d20d2a78ac935bbbe06d60f8b9f71705772674c995c56f925e9
-contract address: 0xb4A57e40bD901D0987F7A3b45ECdE67779E394D6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xd8a3d3c280c625409aaa52c0e8cbf7350c4ae22751c0c76627670c0be85b70f5
-contract address: 0xA16D202146aC158562294F67a5631aabdc96B1aD
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x32ba625b68069b863e911a594214ea7dd7bd7405ba53c21a02572347e88b3c84
-contract address: 0x4A9559FEF44B25F1A7157e047cD09683fe45c599
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0xcf2358a9c62d40389a64cc1952dbfde666b741936ac1b9c094125da2a783d2dd
-contract address: 0xe94Cb57AD747445c13C08A931F3f1421C540eB5F
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xf4aa282d726eed9c329098a21e2df10d8dd5f3adbba8e02624ee881dcfc6c3fa
-contract address: 0xE2ba935c1b3e833aFD45dA9CBCBDd2e90875ba30
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x530d34cbf1eed77cb7b0cf0235e9a52921176944466aeb6f3576db74c39377a0
-contract address: 0x303CEAFd0aF91A63576FF7dEFc01E66ca2D19E3a
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xe6c93a13ec6fdeeb44c80fa9f888ca14fd384acd705866551f893e9839cc0e80
-contract address: 0x5366cD335B002b009304Dc74a21EC97e94510177
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x18896d7ea90749e376733f53ded0bc35192eb240af22e0c2e1ce2351cb6210ac
-contract address: 0x71FF58Af627447C233Febdb9390CFB6c52fAA3a7
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xe9b91854c458b0afc9033dbec4eaf485e4367a1c672d2ab6cf3ec95b87f1ede9
-contract address: 0x3E447b144e446558c2467d95FcF17Eaee9d704Bf
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xeb4d8103ac1056631cbae0553dafbd908049d8feb8b5cca92adbb2d9dbbd79b1
-contract address: 0x6174769FBbC16D956a7bf70c3Ae7283341CAe3B6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x51cb8e5f536a05ca4eb21fe2fb7046a780996def5ded7bbcacdf284ec8a133d1
-contract address: 0x09d5c8d8EB9dF4A9779778d4B2c66943F1A0f923
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0xf53898b9abef9f08550b54f552fd74adee31e74d5986d63d93a5eb6088843769
-contract address: 0x23Fa899d0b780f2f439354DcdC325ff738d1234d
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xe509995bf97d52be3a8e86c57a526f00ef8493fb2dbd6a9af98e9b0469d9d710
-contract address: 0x398A7a447E4D9007Fa1A5F82F2D07F0B369bD26f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xa3ec3a0ff5900819819f1b68b9ef5cea33797ba73c44cc5bc8f767528c84f056
-contract address: 0xE95b5DF6c8c8b8AE04bb8ccA9802E5faf8E2a380
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x6a227b837b83929185ad091b87d8b237f558220bdb7085b4619d62718ba7797a
-contract address: 0x9cbEE5c0A6178F61dcD57C3b21180C8602aBdAc1
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x23fe6c2e83c173ea95031c47d56dc4d279c5d4a1cab6cc46d88f83a771f3abfb
-contract address: 0x3Eb52adc2294219C9A8F27C6a0BCcBBBEEeB0637
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x2c2dc2bc4e87408bd8fbf517c4d6431a3bbadaa8d02d1fa036a5ef1d3eccb8e3
-contract address: 0x1b52F7d75DA9b64daF2D8ad2E7eaf75205c99d3B
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x68e01336deeef4f2d494fa2a4b2d6ff73e64f6d13a79f7f2141de43bf678a3af
-contract address: 0xEC828976783079948F5DfAc8e61de6a895EB59D2
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xc6ec785b8a82511ffcc15c0573fdd6590795705aa29d02fe5d90681226f4d795
-contract address: 0xdB70141346347383D8e01c565E74b1a607f3Dd05
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0xc1e41b9c5256a08443a6eeaf991490c1b460d20ea36ffcac2f38e055a18948cd
-contract address: 0x3597899d1c79b516D724b33c6b5e404dCdD45Da1
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x9b5ec497973ae678f4cffe5845d61c0f44ca824fb8b4552f18014fb203270ca5
-contract address: 0xc489495Ad73C2E75fbBA3916df7BD186F6b1696F
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xf13b63caec88020573d4f55cca61b7891bc5c9d663b7a9fc8b622df4fcf1cecc
-contract address: 0x1FB3ccD743653c4f8533268fFe4a9a9DA97db500
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x6e94e7e8ee70f6df78c35160bcfdcff8682912fcd57a7ca74e3fdae7410dacbe
-contract address: 0x54f9224C1A99951ABc0A7e843CE19a92dFA2E3c4
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x0d9532270cc3f366e8cde750e0505d0970bf6274f2f966d69351a42c0dbdf2c6
-contract address: 0x662b3D8C8Dc691C46334bcB2229336063e3c2487
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xab74ca6869857c82008a1e29326f92573c484db33b618deeb052d4df5f5c0446
-contract address: 0xEa02aebdf8DccbD3bf2BaA9eeBa48b0275D370b8
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x6f687710634d834f8e41044253e3849b15069e8e6bac8456bf271ae029ce2b82
-contract address: 0x5a3343A0CF72dC6933362676Bb5831784CaA0014
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xfc17f737acea5399366c6ee283f8fa33defe386cac8d2bee0b380d6dc414c9e1
-contract address: 0x3c3AB51fF33032159e82E1FDEe6503dEd082F1d9
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x4d4701fadeb218ad077ad9ef81babaffcb738eeb308ca77a7bb02caec4ab961f
-contract address: 0x50fE7A36aE65481EDD7EAc23bb8E317B7B6bB3E4
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x0a2da6bb7bfb307b6b0aea321d5d999ee6f94d1b57a9f7d53cd4aadee8ab645c
-contract address: 0x09e2af829b1C36A6A8876925D1557C0FA1FF7eF5
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x7df04703a54863a123a3c86fca710d1d88977de643750dfe39fedeb9172bcdab
-contract address: 0x912e47ab2257B0fE50516444bb6a12CffaCFA322
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x201043d0143f780adb92bc45f0649929eb3cb113ba929806b8b72f03977e581f
-contract address: 0x04e3A49CE67e0030B455b915c091B02473F0C564
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x68ec4522283aac98f8e96998cf238b33940fb25290d32bdefe1af26f06bd2ed2
-contract address: 0xAB45290275E6970b7B76FbaC8b39619EE05D0B69
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xc0baf40da2684ab97dd25cfd41cfcf156d78120127da7af33f963db2ea01031f
-contract address: 0xb1c9e66a9064208a930e446811aBE8f4c24310e0
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xd49cf021c25e552dc070454193f22f21771fd62c36cc5dd28b32f44b3a199bfa
-contract address: 0x26976F523B6dE4315c6A181b0983Eb98F638Bac6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x64f34395df43a62a220e7d96fffd26860d525f21aca610f1407f1b4486f4865f
-contract address: 0x43d8f4f99eCEE76977B75F1659ad34d6A7652c93
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x59bb3c704f40cfc66fdca8cdd6f499bd7fbc420806d302d14987f030906cab1d
-contract address: 0x2f77845F39273850bf6d734e21c0D8E7bdfF50F8
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x41d6f64f12525966590670c30982789b2e99562af9d2a0734892590a552d3e2f
-contract address: 0x36e10ACD624a048BC1e2B3B70B37B46a4BA36534
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x41288fb10efbd96f61c6a15a83f881d30c46e25636bba4d072d672c759f69b8a
-contract address: 0x708e2B13F6EB3f62686BAC1795c1e3C09e91eEaF
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xd3604771fa07de8a051ceabff9a685d1d79c182732f7e34c0e93ddb015fdac5c
-contract address: 0x65df659Be90a49356a33458d806d9dE3d8F03969
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x92dbacbff977df187e7189123d5b2b63368febb34e761277b7599223582faba8
-contract address: 0xE5464F611113932335B397Eb0dD1601a896005C6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x0148f2dd93282f475c0ac15a07709268c5dd58a6fce01fe55acff3cecf6d8305
-contract address: 0xF0cDB2EcE3A2188048b79B1f94b434c594B807fB
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xdd5e77a53b106861a3e9c2ae036cb8e3d5608237cf43a5b390a8f4547b1487c8
-contract address: 0x7C95b1ad025F0C9aB14192f87bF2aD53889bE4F7
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x798402acc384eddd9197c7375cf9eb31c12e164952c0a1a0aa6db6af9a6d0383
-contract address: 0x9bD0Bec44106D8Ea8fFb6296d7A84742a290E064
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x42639282634282b44aa8f16f23d337dcb57353014dfaa4987856acab3dc16690
-contract address: 0x34Ac3eB6180FdD94043664C22043F004734Dc480
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0xb8ae978124802e1aa93dc3d42da9de44b6d43818fd27d1b3096bda66f31b6959
-contract address: 0x04dE7A5bCCf369cb28AB389BfD7a6262E870B0a6
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x65647123c5a778c59c670e5e15592c0a1b5ab7be584870d199b16d1f169214f5
-contract address: 0xC9366C94D1760624DFa702Ee99a04E9f6271Aa70
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xa288a1069e06c47c959a10a51986209396cba4ec8d5ac056287443b8d5620364
-contract address: 0x54F1df7dB2E46dbeF18CF97A376b79108166fa36
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x80b9a652e3b430b97157425adb5d2c186e0423fa9218a5d0771b1fef786a9c1d
-contract address: 0xe681Daa8C5aA5029F448592566407df7752B598f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x2fbc56e578008d75138a6134da27a28f17f5f273ac2279b9c2bfa6a68fd2d1e2
-contract address: 0x267B07Fd1032e9A4e10dBF2600C8407ee6CA1e8c
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0xc80b72e899c867ccb8ecb02fae690a5875d3c3becfde60cacd2d816f98ded2c1
-contract address: 0x2E10b24b10692fa972510051A1e296D4535043ad
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x118d82908574b47c2c96baea811a1157b7c2bbcbf98233c7d96494d739b40cc2
-contract address: 0xdF19a9539Fdd701D8334299C6Dd04931e4022303
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x314555024b1197ce574d97db099aba5bd79944f22ae9c0d585c80ecf1f9f9eaa
-contract address: 0x02BB514187B830d6A2111197cd7D8cb60650B970
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x94bce0fa8e80f653108a008145512d3ba902bbb49ef77380b0b01992e6dd1798
-contract address: 0x6774Ce86Abf5EBB22E9F45b5f55daCbB4170aD7f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x7b24ce6596f6079de9c62f7718e9d1f4e6473018c6302bb9fc1ccafe855826e3
-contract address: 0x06b98cAa1CAAe2B91Fb9af09348eDC09CEe99785
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x5b415df3d680696fde66f03dc345437ea6069a445c480ad02775a68a42b805d3
-contract address: 0xd8f831Ef919D3f38694f2797CD44D7Cc7d595A67
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x3bb8d016b9f8fa56f58208510459ca98e612d04dd414029a6e800c81bd503cfb
-contract address: 0xc52Df73f1BBe582061C65a2bd36A1d685f0a2BE5
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2893975
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x4f8e0f57cfed31132f47c4da4da70270934af455ee96e58ffa197115311d87c8
-contract address: 0x90E125753e21Eb5b955e9C0937E372061151AbC9
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x3b331d27bec69ae268455156f9098a02e64d91f0a4a344b6fb9b17de5ce1edf0
-contract address: 0x09157249a5937Bd78fea52CE189887Bd55c13050
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0x663957fccce41b06194f2231e610677c80a3eacdd493c5a1742594cbe16915cf
-contract address: 0xF85d6001ADaD5376ef63143bdf1f11D9b163ac4f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x5b6663de08b715d3fa236fccef530ed9dee2ce565360ebcc99a6c01f9bf92ea7
-contract address: 0xEe0765D93faB6C76de1Bf6026Ba7437695B43aC5
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x55dba43d79dcfed558dedf193d37386f890a33d7bb5e96085b1e68f5e996933d
-contract address: 0x532447985f1d598c0B07DE5310953d6AE6253F09
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x21f04ccc7c43f69d69d56a47aaba9e73afc97a3c24c0e3292aadebab57ac8d93
-contract address: 0x2c71cD16ec6a8AC3F0768ff56A6Ab944F676cFe2
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xa189496ad16fe2b668bb2b7f3a94326a35714b69c285bb7b07414fc5af6ad2ff
-contract address: 0x8eF6CAbcAE15FB78b436e67B26FFE80Ba7ef8424
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** DefaultReserveInterestRateStrategy ***
-
-Network: localhost
-tx: 0x08b33ac77d57c986ed8294b8ad9ed271fc83afe9447168ac586c982568e47fee
-contract address: 0xA106BFbDB5C925A04358bE49db41aDd308a1458f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2894455
-
-******
-
-*** StableDebtToken ***
-
-Network: localhost
-tx: 0x94451a9819c88f248847094985b88e7c3770313cc9d1acc80fd07b2a30354d40
-contract address: 0x9c91aEaD98b1354C7B0EAfb8ff539d0796c79894
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5442070
-
-******
-
-*** VariableDebtToken ***
-
-Network: localhost
-tx: 0x7596bc800660d0cf45c83079467d411e49a3c545583b5862d18b1e33404587e6
-contract address: 0x145b7B6368Df63e7F3497b0A948B30fC1A4d5E55
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 5016520
-
-******
-
-*** AToken ***
-
-Network: localhost
-tx: 0xe22c7593b3442952259b1619377a2c4a4978f0e818010289eb8975e8cb665c2b
-contract address: 0x142bFA0788F794d3D0aE1EC36373ee034aABC11f
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 9499999
-
-******
-
-*** TokenDistributor ***
-
-Network: localhost
-tx: 0xb829e68bba9b67bcd27c4793b8e25aceca28324f38177175d0ee529723834c01
-contract address: 0xEd9d04D6ab74581b95567C9aFcF8459B5a6A4Ccf
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 7785615
-
-******
-
-WARNING: Multiple definitions for initialize
-*** InitializableAdminUpgradeabilityProxy ***
-
-Network: localhost
-tx: 0xd1a52cdd2095ee0d3609f3600f6c89fc734549e1a67a81ddfa91782f0bb07368
-contract address: 0x8E2a05B9Abd9a2a3046879074d7D136213AaDCb9
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2954430
-
-******
-
-*** MockFlashLoanReceiver ***
-
-Network: localhost
-tx: 0x361c98faf968a5f0e753ae6e5cdadf97b57be83cddd44fc925c4b1f0998eaedb
-contract address: 0x8EA6693b23224fFD1C2AfbB161f15b398F8cB5FA
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2861720
-
-******
-
-*** WalletBalanceProvider ***
-
-Network: localhost
-tx: 0x00e823ab98484ebe48686e7e2dd79cd57b114209c6967cf00a37423e29b5769a
-contract address: 0xFb017937aB8EABb9506A03E6c76DcA99C6D095c7
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2899900
-
-******
-
-*** AaveProtocolTestHelpers ***
-
-Network: localhost
-tx: 0xc8f41a659f0db9fcce0769dc2e51937a1629912260de835a53a682ac1df5a95a
-contract address: 0xc6b70Da02A963fCA0016C7548E1f43511EFe11eC
-deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6
-gas price: 8000000000
-gas used: 2818975
-
-******
-
-setup: 35.826s
-Pool loaded
-Configurator loaded
-
-***************
-Setup and snapshot finished
-***************
-
-  AToken: Modifiers
-    ✓ Tries to invoke mintOnDeposit not being the LendingPool
-    ✓ Tries to invoke burnOnLiquidation not being the LendingPool
-    ✓ Tries to invoke transferOnLiquidation not being the LendingPool
-    ✓ Tries to invoke transferUnderlyingTo not being the LendingPool
-
-  AToken: Transfer
-    ✓ User 0 deposits 1000 DAI, transfers to user 1
-    ✓ User 1 redirects interest to user 2, transfers 500 DAI back to user 0
-    ✓ User 0 transfers back to user 1
-    ✓ User 0 deposits 1 ETH and user tries to borrow, but the aTokens received as a transfer are not available as collateral (revert expected)
-    ✓ User 1 sets the DAI as collateral and borrows, tries to transfer everything back to user 0 (revert expected)
-    ✓ User 0 tries to transfer 0 balance (revert expected)
-    ✓ User 1 repays the borrow, transfers aDAI back to user 0
-    ✓ User 0 redirects interest to user 2, transfers 500 aDAI to user 1. User 1 redirects to user 3. User 0 transfers another 100 aDAI
-    ✓ User 1 transfers the whole amount to himself
-
-  LendingPoolConfigurator
-
-    1) Deactivates the ETH reserve
-    ✓ Rectivates the ETH reserve
-    ✓ Check the onlyLendingPoolManager on deactivateReserve 
-    ✓ Check the onlyLendingPoolManager on activateReserve 
-    ✓ Freezes the ETH reserve
-    ✓ Unfreezes the ETH reserve
-    ✓ Check the onlyLendingPoolManager on freezeReserve 
-    ✓ Check the onlyLendingPoolManager on unfreezeReserve 
-    ✓ Deactivates the ETH reserve for borrowing
-
-    2) Activates the ETH reserve for borrowing
-    ✓ Check the onlyLendingPoolManager on disableBorrowingOnReserve 
-    ✓ Check the onlyLendingPoolManager on enableBorrowingOnReserve 
-    ✓ Deactivates the ETH reserve as collateral
-    ✓ Activates the ETH reserve as collateral
-    ✓ Check the onlyLendingPoolManager on disableReserveAsCollateral 
-    ✓ Check the onlyLendingPoolManager on enableReserveAsCollateral 
-    ✓ Disable stable borrow rate on the ETH reserve
-    ✓ Enables stable borrow rate on the ETH reserve
-    ✓ Check the onlyLendingPoolManager on disableReserveStableRate
-    ✓ Check the onlyLendingPoolManager on enableReserveStableRate
-    ✓ Changes LTV of the reserve
-    ✓ Check the onlyLendingPoolManager on setLtv
-    ✓ Changes liquidation threshold of the reserve
-    ✓ Check the onlyLendingPoolManager on setLiquidationThreshold
-    ✓ Changes liquidation bonus of the reserve
-    ✓ Check the onlyLendingPoolManager on setLiquidationBonus
-    ✓ Check the onlyLendingPoolManager on setReserveDecimals
-    ✓ Check the onlyLendingPoolManager on setLiquidationBonus
-    ✓ Reverts when trying to disable the DAI reserve with liquidity on it
-
-  LendingPool FlashLoan function
-    ✓ Deposits ETH into the reserve
-
-    3) Takes ETH flashloan, returns the funds correctly
-
-    4) Takes an ETH flashloan as big as the available liquidity
-    ✓ Takes ETH flashloan, does not return the funds (revert expected)
-    ✓ tries to take a very small flashloan, which would result in 0 fees (revert expected)
-
-    5) tries to take a flashloan that is bigger than the available liquidity (revert expected)
-    ✓ tries to take a flashloan using a non contract address as receiver (revert expected)
-    ✓ Deposits DAI into the reserve
-
-    6) Takes out a 500 DAI flashloan, returns the funds correctly
-    ✓ Takes out a 500 DAI flashloan, does not return the funds (revert expected)
-
-  LendingPoolAddressesProvider
-    ✓ Test the accessibility of the LendingPoolAddressesProvider
-
-  LendingPool liquidation - liquidator receiving aToken
-
-    7) LIQUIDATION - Deposits ETH, borrows DAI/Check liquidation fails because health factor is above 1
-
-    8) LIQUIDATION - Drop the health factor below 1
-
-    9) LIQUIDATION - Tries to liquidate a different currency than the loan principal
-
-    10) LIQUIDATION - Tries to liquidate a different collateral than the borrower collateral
-
-    11) LIQUIDATION - Liquidates the borrow
-
-    12) User 3 deposits 1000 USDC, user 4 1 ETH, user 4 borrows - drops HF, liquidates the borrow
-
-  LendingPool liquidation - liquidator receiving the underlying asset
-
-    13) LIQUIDATION - Deposits ETH, borrows DAI
-
-    14) LIQUIDATION - Drop the health factor below 1
-
-    15) LIQUIDATION - Liquidates the borrow
-
-    16) User 3 deposits 1000 USDC, user 4 1 ETH, user 4 borrows - drops HF, liquidates the borrow
-
-    17) User 4 deposits 1000 LEND - drops HF, liquidates the LEND, which results on a lower amount being liquidated
-
-  LendingPool: Borrow negatives (reverts)
-    ✓ User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and tries to borrow 100 DAI with rate mode NONE (revert expected)
-    ✓ User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and tries to borrow 100 DAI with an invalid rate mode (revert expected)
-
-  LendingPool: Borrow/repay (stable rate)
-
-    18) User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and borrows 100 DAI at stable rate
-    ✓ User 1 tries to borrow the rest of the DAI liquidity (revert expected)
-    ✓ User 1 repays the DAI borrow after one year
-    ✓ User 0 redeems the deposited DAI plus interest
-
-    19) User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected)
-
-    20) User 0 deposits 1000 DAI, user 1,2,3,4 deposit 1 ETH each and borrow 100 DAI at stable rate. Everything is repaid, user 0 redeems
-    ✓ User 0 deposits 1000 DAI, user 1 deposits 2 ETH and borrow 100 DAI at stable rate first, then 100 DAI at variable rate, repays everything. User 0 redeems
-
-  LendingPool: Borrow/repay (variable rate)
-    ✓ User 2 deposits 1 DAI to account for rounding errors
-    ✓ User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and borrows 100 DAI at variable rate
-    ✓ User 1 tries to borrow the rest of the DAI liquidity (revert expected)
-    ✓ User 1 tries to repay 0 DAI (revert expected)
-    ✓ User 1 repays a small amount of DAI, enough to cover a small part of the interest
-    ✓ User 1 repays the DAI borrow after one year
-    ✓ User 0 redeems the deposited DAI plus interest
-    ✓ User 1 redeems the collateral
-    ✓ User 2 deposits a small amount of ETH to account for rounding errors
-    ✓ User 0 deposits 1 ETH, user 1 deposits 100 LINK as collateral and borrows 0.5 ETH at variable rate
-    ✓ User 1 tries to repay 0 ETH
-    ✓ User 1 tries to repay without sending any ETH value (revert expected)
-    ✓ User 2 tries to repay everything on behalf of user 1 using uint(-1) (revert expected)
-    ✓ User 3 repays a small amount of ETH on behalf of user 1
-    ✓ User 1 repays the ETH borrow after one year
-    ✓ User 0 redeems the deposited ETH plus interest
-    ✓ User 1 redeems the collateral
-    ✓ User 2 deposits 1 USDC to account for rounding errors
-    ✓ User 0 deposits 1000 USDC, user 1 deposits 1 ETH as collateral and borrows 100 USDC at variable rate
-
-    21) User 1 tries to borrow the rest of the USDC liquidity (revert expected)
-    ✓ User 1 repays the USDC borrow after one year
-    ✓ User 0 redeems the deposited USDC plus interest
-    ✓ User 1 redeems the collateral
-
-    22) User 1 deposits 1000 DAI, user 3 tries to borrow 1000 DAI without any collateral (revert expected)
-
-    23) user 3 deposits 0.1 ETH collateral to borrow 100 DAI; 0.1 ETH is not enough to borrow 100 DAI (revert expected)
-    ✓ user 3 redeems the 0.1 ETH
-    ✓ User 1 deposits 1000 USDC, user 3 tries to borrow 1000 USDC without any collateral (revert expected)
-
-    24) user 3 deposits 0.1 ETH collateral to borrow 100 USDC; 0.1 ETH is not enough to borrow 100 USDC (revert expected)
-    ✓ user 3 redeems the 0.1 ETH
-
-    25) User 0 deposits 1000 DAI, user 6 deposits 2 ETH and borrow 100 DAI at variable rate first, then 100 DAI at stable rate, repays everything. User 0 redeems
-
-  LendingPool: Deposit
-    ✓ User 0 Deposits 1000 DAI in an empty reserve
-    ✓ User 1 deposits 1000 DAI after user 1
-    ✓ User 0 deposits 1000 USDC in an empty reserve
-    ✓ User 1 deposits 1000 USDC after user 0
-    ✓ User 0 deposits 1 ETH in an empty reserve
-    ✓ User 1 deposits 1 ETH after user 0
-    ✓ User 1 deposits 0 ETH (revert expected)
-    ✓ User 1 deposits 0 DAI
-    ✓ User 1 tries to deposit ETH without sending any value
-    ✓ User 1 tries to deposit ETH by sending less value than required
-
-  AToken: interest rate redirection negative test cases
-    ✓ User 0 deposits 1000 DAI, tries to give allowance to redirect interest to himself (revert expected)
-    ✓ User 1 tries to redirect the interest of user 0 without allowance (revert expected)
-
-    26) User 0 tries to redirect the interest to user 2 twice (revert expected)
-
-    27) User 3 with 0 balance tries to redirect the interest to user 2 (revert expected)
-
-  AToken: interest rate redirection
-
-    28) User 0 deposits 1000 DAI, redirects the interest to user 2
-    ✓ User 1 deposits 1 ETH, borrows 100 DAI, repays after one year. Users 0 deposits another 1000 DAI. Redirected balance of user 2 is updated
-    ✓ User 1 borrows another 100 DAI, repay the whole amount. Users 0 and User 2 redeem
-
-    29) User 0 deposits 1000 DAI, redirects interest to user 2, user 1 borrows 100 DAI. After one year, user 0 redirects interest back to himself, user 1 borrows another 100 DAI and after another year repays the whole amount. Users 0 and User 2 redeem
-
-    30) User 0 deposits 1000 DAI, redirects interest to user 2, user 1 borrows 100 DAI. After one year, user 2 redirects interest to user 3. user 1 borrows another 100 DAI, user 0 deposits another 100 DAI. User 1 repays the whole amount. Users 0, 2 first 1 DAI, then everything. User 3 redeems
-
-  LendingPool: Rebalance stable rate
-    ✓ User 0 tries to rebalance user 1 who has no borrows in progress (revert expected)
-    ✓ User 0 deposits 1000 DAI, user 1 deposits 1 ETH, borrows 100 DAI at a variable rate, user 0 rebalances user 1 (revert expected)
-
-    31) User 1 swaps to stable, user 0 tries to rebalance but the conditions are not met (revert expected)
-
-    32) User 2 deposits ETH and borrows the remaining DAI, causing the stable rates to rise (liquidity rate < user 1 borrow rate). User 0 tries to rebalance user 1 (revert expected)
-
-    33) User 2 borrows more DAI, causing the liquidity rate to rise above user 1 stable borrow rate User 0 rebalances user 1
-
-  LendingPool: Redeem negative test cases
-    ✓ Users 0 Deposits 1000 DAI and tries to redeem 0 DAI (revert expected)
-
-    34) Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected)
-
-    35) Users 1 deposits 1 ETH, borrows 100 DAI, tries to redeem the 1 ETH deposited (revert expected)
-
-  LendingPool: Redeem
-    ✓ User 0 Deposits 1000 DAI in an empty reserve
-    ✓ User 0 redeems half of the deposited DAI
-    ✓ User 0 redeems remaining half of the deposited DAI
-    ✓ User 0 Deposits 1000 USDC in an empty reserve
-    ✓ User 0 redeems half of the deposited USDC
-    ✓ User 0 redeems remaining half of the deposited USDC
-    ✓ User 0 Deposits 1 ETH in an empty reserve
-    ✓ User 0 redeems half of the deposited ETH
-    ✓ User 0 redeems remaining half of the deposited ETH
-
-    36) Users 0 and 1 Deposit 1000 DAI, both redeem
-    ✓ Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 ETH, borrows 100 DAI. User 1 tries to redeem all the USDC
-
-  LendingPool: Usage as collateral
-
-    37) User 0 Deposits 1000 DAI, disables DAI as collateral
-
-    38) User 1 Deposits 2 ETH, disables ETH as collateral, borrows 400 DAI (revert expected)
-    ✓ User 1 enables ETH as collateral, borrows 400 DAI
-
-    39) User 1 disables ETH as collateral (revert expected)
-
-  LendingPool: Swap rate mode
-    ✓ User 0 tries to swap rate mode without any variable rate loan in progress (revert expected)
-
-    40) User 0 tries to swap rate mode without any stable rate loan in progress (revert expected)
-
-    41) User 0 deposits 1000 DAI, user 1 deposits 2 ETH as collateral, borrows 100 DAI at variable rate and swaps to stable after one year
-
-    42) User 1 borrows another 100 DAI, and swaps back to variable after one year, repays the loan
-
-  Stable debt token tests
-    ✓ Tries to invoke mint not being the LendingPool
-    ✓ Tries to invoke burn not being the LendingPool
-
-  Variable debt token tests
-    ✓ Tries to invoke mint not being the LendingPool
-    ✓ Tries to invoke burn not being the LendingPool
-
-·------------------------------------------------------------------|---------------------------|-------------|-----------------------------·
-|                       Solc version: 0.6.8                        ·  Optimizer enabled: true  ·  Runs: 200  ·  Block limit: 10000000 gas  │
-···································································|···························|·············|······························
-|  Methods                                                         ·               75 gwei/gas               ·       320.77 eur/eth        │
-·································|·································|·············|·············|·············|···············|··············
-|  Contract                      ·  Method                         ·  Min        ·  Max        ·  Avg        ·  # calls      ·  eur (avg)  │
-·································|·································|·············|·············|·············|···············|··············
-|  AToken                        ·  redeem                         ·     245418  ·     619747  ·     502050  ·           32  ·      12.08  │
-·································|·································|·············|·············|·············|···············|··············
-|  AToken                        ·  redirectInterestStream         ·     130611  ·     149823  ·     143415  ·            3  ·       3.45  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  borrow                         ·     556414  ·     628041  ·     586871  ·           17  ·      14.12  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  deposit                        ·     169815  ·     332253  ·     220161  ·           69  ·       5.30  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  flashLoan                      ·     148930  ·     189947  ·     169439  ·            2  ·       4.08  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  repay                          ·      97914  ·     253341  ·     175710  ·           15  ·       4.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  setUserUseReserveAsCollateral  ·      99215  ·     404713  ·     201091  ·            3  ·       4.84  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPool                   ·  swapBorrowRateMode             ·          -  ·          -  ·     235403  ·            4  ·       5.66  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolAddressesProvider  ·  transferOwnership              ·          -  ·          -  ·      30839  ·            1  ·       0.74  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  activateReserve                ·          -  ·          -  ·      47054  ·            4  ·       1.13  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  disableBorrowingOnReserve      ·          -  ·          -  ·      51242  ·            1  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  disableReserveAsCollateral     ·          -  ·          -  ·      51156  ·            2  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  disableReserveStableRate       ·          -  ·          -  ·      51285  ·            2  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  enableBorrowingOnReserve       ·          -  ·          -  ·      51767  ·            3  ·       1.25  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  enableReserveAsCollateral      ·          -  ·          -  ·      52667  ·            4  ·       1.27  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  enableReserveStableRate        ·          -  ·          -  ·      51165  ·            4  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  freezeReserve                  ·          -  ·          -  ·      51200  ·            2  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  setLiquidationBonus            ·          -  ·          -  ·      51477  ·            5  ·       1.24  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  setLiquidationThreshold        ·          -  ·          -  ·      51500  ·            3  ·       1.24  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  setLtv                         ·          -  ·          -  ·      51506  ·            3  ·       1.24  │
-·································|·································|·············|·············|·············|···············|··············
-|  LendingPoolConfigurator       ·  unfreezeReserve                ·          -  ·          -  ·      51263  ·            4  ·       1.23  │
-·································|·································|·············|·············|·············|···············|··············
-|  MintableERC20                 ·  approve                        ·      24907  ·      44119  ·      33110  ·           29  ·       0.80  │
-·································|·································|·············|·············|·············|···············|··············
-|  MintableERC20                 ·  mint                           ·      35427  ·      65475  ·      41150  ·           29  ·       0.99  │
-·································|·································|·············|·············|·············|···············|··············
-|  MintableERC20                 ·  transfer                       ·     211451  ·     542702  ·     437409  ·           13  ·      10.52  │
-·································|·································|·············|·············|·············|···············|··············
-|  MockFlashLoanReceiver         ·  setFailExecutionTransfer       ·          -  ·          -  ·      27239  ·            6  ·       0.66  │
-·································|·································|·············|·············|·············|···············|··············
-|  Deployments                                                     ·                                         ·  % of limit   ·             │
-···································································|·············|·············|·············|···············|··············
-|  ValidationLogic                                                 ·          -  ·          -  ·    1232435  ·       12.3 %  ·      29.65  │
-·------------------------------------------------------------------|-------------|-------------|-------------|---------------|-------------·
-
-  111 passing (8m)
-  42 failing
-
-  1) LendingPoolConfigurator
-       Deactivates the ETH reserve:
-     Error: VM Exception while processing transaction: revert The liquidity of the reserve needs to be 0
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  2) LendingPoolConfigurator
-       Activates the ETH reserve for borrowing:
-
-      AssertionError: expected '1000000000951293759814590868' to equal '1000000000000000000000000000'
-      + expected - actual
-
-      -1000000000951293759814590868
-      +1000000000000000000000000000
-      
-      at /src/test/configurator.spec.ts:199:66
-      at step (test/configurator.spec.ts:33:23)
-      at Object.next (test/configurator.spec.ts:14:53)
-      at fulfilled (test/configurator.spec.ts:5:58)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  3) LendingPool FlashLoan function
-       Takes ETH flashloan, returns the funds correctly:
-
-      AssertionError: expected '2000504000285388128' to equal '1000504000000000000'
-      + expected - actual
-
-      -2000504000285388128
-      +1000504000000000000
-      
-      at /src/test/flashloan.spec.ts:112:61
-      at step (test/flashloan.spec.ts:33:23)
-      at Object.next (test/flashloan.spec.ts:14:53)
-      at fulfilled (test/flashloan.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  4) LendingPool FlashLoan function
-       Takes an ETH flashloan as big as the available liquidity:
-
-      AssertionError: expected '2001134317805388128' to equal '1001134317520000000'
-      + expected - actual
-
-      -2001134317805388128
-      +1001134317520000000
-      
-      at /src/test/flashloan.spec.ts:148:61
-      at step (test/flashloan.spec.ts:33:23)
-      at Object.next (test/flashloan.spec.ts:14:53)
-      at fulfilled (test/flashloan.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  5) LendingPool FlashLoan function
-       tries to take a flashloan that is bigger than the available liquidity (revert expected):
-
-      AssertionError: There is not enough liquidity available to borrow: Expected transaction to be reverted with There is not enough liquidity available to borrow, but other exception was thrown: VM Exception while processing transaction: revert The actual balance of the protocol is inconsistent
-      + expected - actual
-
-      -VM Exception while processing transaction: revert The actual balance of the protocol is inconsistent
-      +Transaction reverted with There is not enough liquidity available to borrow.
-      
-  
-
-  6) LendingPool FlashLoan function
-       Takes out a 500 DAI flashloan, returns the funds correctly:
-     AssertionError: Expected "3000315000000000000000" to be equal 1000315000000000000000
-      at /src/test/flashloan.spec.ts:275:50
-      at step (test/flashloan.spec.ts:33:23)
-      at Object.next (test/flashloan.spec.ts:14:53)
-      at fulfilled (test/flashloan.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  7) LendingPool liquidation - liquidator receiving aToken
-       LIQUIDATION - Deposits ETH, borrows DAI/Check liquidation fails because health factor is above 1:
-
-      AssertionError: expected '4239' to equal '8000'
-      + expected - actual
-
-      -4239
-      +8000
-      
-      at /src/test/liquidation-atoken.spec.ts:115:93
-      at step (test/liquidation-atoken.spec.ts:33:23)
-      at Object.next (test/liquidation-atoken.spec.ts:14:53)
-      at fulfilled (test/liquidation-atoken.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  8) LendingPool liquidation - liquidator receiving aToken
-       LIQUIDATION - Drop the health factor below 1:
-
-      AssertionError: expected '1124284537640968172' to be less than '1000000000000000000'
-      + expected - actual
-
-      -1124284537640968172
-      +1000000000000000000
-      
-      at /src/test/liquidation-atoken.spec.ts:141:84
-      at step (test/liquidation-atoken.spec.ts:33:23)
-      at Object.next (test/liquidation-atoken.spec.ts:14:53)
-      at fulfilled (test/liquidation-atoken.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  9) LendingPool liquidation - liquidator receiving aToken
-       LIQUIDATION - Tries to liquidate a different currency than the loan principal:
-
-      AssertionError: Expected transaction to be reverted with User did not borrow the specified currency, but other exception was thrown: VM Exception while processing transaction: revert Health factor is not below the threshold
-      + expected - actual
-
-      -VM Exception while processing transaction: revert Health factor is not below the threshold
-      +Transaction reverted with User did not borrow the specified currency.
-      
-  
-
-  10) LendingPool liquidation - liquidator receiving aToken
-       LIQUIDATION - Tries to liquidate a different collateral than the borrower collateral:
-
-      AssertionError: Expected transaction to be reverted with Invalid collateral to liquidate, but other exception was thrown: VM Exception while processing transaction: revert Health factor is not below the threshold
-      + expected - actual
-
-      -VM Exception while processing transaction: revert Health factor is not below the threshold
-      +Transaction reverted with Invalid collateral to liquidate.
-      
-  
-
-  11) LendingPool liquidation - liquidator receiving aToken
-       LIQUIDATION - Liquidates the borrow:
-     Error: VM Exception while processing transaction: revert Health factor is not below the threshold
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  12) LendingPool liquidation - liquidator receiving aToken
-       User 3 deposits 1000 USDC, user 4 1 ETH, user 4 borrows - drops HF, liquidates the borrow:
-     Error: VM Exception while processing transaction: revert SafeMath: division by zero
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  13) LendingPool liquidation - liquidator receiving the underlying asset
-       LIQUIDATION - Deposits ETH, borrows DAI:
-
-      AssertionError: expected '3713' to equal '8000'
-      + expected - actual
-
-      -3713
-      +8000
-      
-      at /src/test/liquidation-underlying.spec.ts:131:104
-      at step (test/liquidation-underlying.spec.ts:33:23)
-      at Object.next (test/liquidation-underlying.spec.ts:14:53)
-      at fulfilled (test/liquidation-underlying.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  14) LendingPool liquidation - liquidator receiving the underlying asset
-       LIQUIDATION - Drop the health factor below 1:
-
-      AssertionError: expected '1071094219531376009' to be less than '1000000000000000000'
-      + expected - actual
-
-      -1071094219531376009
-      +1000000000000000000
-      
-      at /src/test/liquidation-underlying.spec.ts:152:84
-      at step (test/liquidation-underlying.spec.ts:33:23)
-      at Object.next (test/liquidation-underlying.spec.ts:14:53)
-      at fulfilled (test/liquidation-underlying.spec.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  15) LendingPool liquidation - liquidator receiving the underlying asset
-       LIQUIDATION - Liquidates the borrow:
-     Error: VM Exception while processing transaction: revert Health factor is not below the threshold
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  16) LendingPool liquidation - liquidator receiving the underlying asset
-       User 3 deposits 1000 USDC, user 4 1 ETH, user 4 borrows - drops HF, liquidates the borrow:
-     Error: VM Exception while processing transaction: revert Health factor is not below the threshold
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  17) LendingPool liquidation - liquidator receiving the underlying asset
-       User 4 deposits 1000 LEND - drops HF, liquidates the LEND, which results on a lower amount being liquidated:
-     Error: VM Exception while processing transaction: revert Health factor is not below the threshold
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  18) LendingPool: Borrow/repay (stable rate)
-       User 0 deposits 1000 DAI, user 1 deposits 1 ETH as collateral and borrows 100 DAI at stable rate:
-     Error: VM Exception while processing transaction: revert There is not enough collateral to cover a new borrow
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  19) LendingPool: Borrow/repay (stable rate)
-       User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected):
-
-      AssertionError: expected '0' to be almost equal or equal '430000012860363335935' for property principalStableDebt
-      + expected - actual
-
-      -0
-      +430000012860363335935
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:206:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  20) LendingPool: Borrow/repay (stable rate)
-       User 0 deposits 1000 DAI, user 1,2,3,4 deposit 1 ETH each and borrow 100 DAI at stable rate. Everything is repaid, user 0 redeems:
-     Error: VM Exception while processing transaction: revert There is not enough collateral to cover a new borrow
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  21) LendingPool: Borrow/repay (variable rate)
-       User 1 tries to borrow the rest of the USDC liquidity (revert expected):
-
-      AssertionError: There is not enough collateral to cover a new borrow: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  22) LendingPool: Borrow/repay (variable rate)
-       User 1 deposits 1000 DAI, user 3 tries to borrow 1000 DAI without any collateral (revert expected):
-
-      AssertionError: The collateral balance is 0: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  23) LendingPool: Borrow/repay (variable rate)
-       user 3 deposits 0.1 ETH collateral to borrow 100 DAI; 0.1 ETH is not enough to borrow 100 DAI (revert expected):
-
-      AssertionError: There is not enough collateral to cover a new borrow: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  24) LendingPool: Borrow/repay (variable rate)
-       user 3 deposits 0.1 ETH collateral to borrow 100 USDC; 0.1 ETH is not enough to borrow 100 USDC (revert expected):
-
-      AssertionError: There is not enough collateral to cover a new borrow: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  25) LendingPool: Borrow/repay (variable rate)
-       User 0 deposits 1000 DAI, user 6 deposits 2 ETH and borrow 100 DAI at variable rate first, then 100 DAI at stable rate, repays everything. User 0 redeems:
-     Error: VM Exception while processing transaction: revert There is not enough collateral to cover a new borrow
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  26) AToken: interest rate redirection negative test cases
-       User 0 tries to redirect the interest to user 2 twice (revert expected):
-
-      AssertionError: expected '3000000004822739128894' to be almost equal or equal '3000002775243319210929' for property redirectionAddressRedirectedBalance
-      + expected - actual
-
-      -3000000004822739128894
-      +3000002775243319210929
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:537:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  27) AToken: interest rate redirection negative test cases
-       User 3 with 0 balance tries to redirect the interest to user 2 (revert expected):
-
-      AssertionError: Interest stream can only be redirected if there is a valid balance: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  28) AToken: interest rate redirection
-       User 0 deposits 1000 DAI, redirects the interest to user 2:
-     Error: VM Exception while processing transaction: revert Interest is already redirected to the user
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  29) AToken: interest rate redirection
-       User 0 deposits 1000 DAI, redirects interest to user 2, user 1 borrows 100 DAI. After one year, user 0 redirects interest back to himself, user 1 borrows another 100 DAI and after another year repays the whole amount. Users 0 and User 2 redeem:
-
-      AssertionError: expected '1020723447797511083136' to be almost equal or equal '1020723447806037392232' for property redirectionAddressRedirectedBalance
-      + expected - actual
-
-      -1020723447797511083136
-      +1020723447806037392232
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:537:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  30) AToken: interest rate redirection
-       User 0 deposits 1000 DAI, redirects interest to user 2, user 1 borrows 100 DAI. After one year, user 2 redirects interest to user 3. user 1 borrows another 100 DAI, user 0 deposits another 100 DAI. User 1 repays the whole amount. Users 0, 2 first 1 DAI, then everything. User 3 redeems:
-     Error: VM Exception while processing transaction: revert Interest is already redirected to the user
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  31) LendingPool: Rebalance stable rate
-       User 1 swaps to stable, user 0 tries to rebalance but the conditions are not met (revert expected):
-     Error: VM Exception while processing transaction: revert 12
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  32) LendingPool: Rebalance stable rate
-       User 2 deposits ETH and borrows the remaining DAI, causing the stable rates to rise (liquidity rate < user 1 borrow rate). User 0 tries to rebalance user 1 (revert expected):
-     Error: VM Exception while processing transaction: revert There is not enough collateral to cover a new borrow
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  33) LendingPool: Rebalance stable rate
-       User 2 borrows more DAI, causing the liquidity rate to rise above user 1 stable borrow rate User 0 rebalances user 1:
-     Error: VM Exception while processing transaction: revert There is not enough collateral to cover a new borrow
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  34) LendingPool: Redeem negative test cases
-       Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected):
-
-      AssertionError: User cannot redeem more than the available balance: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  35) LendingPool: Redeem negative test cases
-       Users 1 deposits 1 ETH, borrows 100 DAI, tries to redeem the 1 ETH deposited (revert expected):
-
-      AssertionError: Transfer cannot be allowed.: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  36) LendingPool: Redeem
-       Users 0 and 1 Deposit 1000 DAI, both redeem:
-
-      AssertionError: expected '100000000000000000000' to be almost equal or equal '101885376842214025499' for property principalStableDebt
-      + expected - actual
-
-      -100000000000000000000
-      +101885376842214025499
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:206:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  37) LendingPool: Usage as collateral
-       User 0 Deposits 1000 DAI, disables DAI as collateral:
-
-      AssertionError: expected '3000000006486135113480' to be almost equal or equal '3000000005405612189577' for property currentATokenBalance
-      + expected - actual
-
-      -3000000006486135113480
-      +3000000005405612189577
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:420:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-  38) LendingPool: Usage as collateral
-       User 1 Deposits 2 ETH, disables ETH as collateral, borrows 400 DAI (revert expected):
-
-      AssertionError: The collateral balance is 0: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  39) LendingPool: Usage as collateral
-       User 1 disables ETH as collateral (revert expected):
-
-      AssertionError: User deposit is already being used as collateral: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  40) LendingPool: Swap rate mode
-       User 0 tries to swap rate mode without any stable rate loan in progress (revert expected):
-
-      AssertionError: User does not have a stable rate loan in progress on this reserve: Expected transaction to be reverted
-      + expected - actual
-
-      -Transaction NOT reverted.
-      +Transaction reverted.
-      
-  
-
-  41) LendingPool: Swap rate mode
-       User 0 deposits 1000 DAI, user 1 deposits 2 ETH as collateral, borrows 100 DAI at variable rate and swaps to stable after one year:
-     Error: VM Exception while processing transaction: revert 12
-      at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34)
-      at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21
-      at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12)
-      at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48)
-      at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/ethers/providers/json-rpc-provider.js:304:29)
-      at /src/node_modules/ethers/providers/base-provider.js:846:34
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-      at async Promise.all (index 1)
-      at async Promise.all (index 0)
-
-  42) LendingPool: Swap rate mode
-       User 1 borrows another 100 DAI, and swaps back to variable after one year, repays the loan:
-
-      AssertionError: expected '10711430955331434378759' to be almost equal or equal '10652813512167291105893' for property totalLiquidity
-      + expected - actual
-
-      -10711430955331434378759
-      +10652813512167291105893
-      
-      at expectEqual (test/helpers/actions.ts:618:30)
-      at /src/test/helpers/actions.ts:458:17
-      at step (test/helpers/actions.ts:33:23)
-      at Object.next (test/helpers/actions.ts:14:53)
-      at fulfilled (test/helpers/actions.ts:5:58)
-      at runMicrotasks (<anonymous>)
-      at processTicksAndRejections (internal/process/task_queues.js:97:5)
-
-
-

From 9a4ccde6a2bcd9033d0f49c211219a7ce08d32ac Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 19:00:08 +0200
Subject: [PATCH 8/9] Removed obsolete code

---
 contracts/lendingpool/LendingPool.sol | 2 --
 1 file changed, 2 deletions(-)

diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol
index 34dc769b..d51f2e2a 100644
--- a/contracts/lendingpool/LendingPool.sol
+++ b/contracts/lendingpool/LendingPool.sol
@@ -239,8 +239,6 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable, ILendingPool {
   ) external override nonReentrant {
     ReserveLogic.ReserveData storage reserve = _reserves[asset];
 
-    (uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebt(_onBehalfOf, reserve);
-
     ReserveLogic.InterestRateMode rateMode = ReserveLogic.InterestRateMode(_rateMode);
     
     //default to max amount

From 796dc8ee3fbf5beca24aaa3dcc798966ffd47107 Mon Sep 17 00:00:00 2001
From: The3D <emilio@aave.com>
Date: Fri, 21 Aug 2020 19:10:48 +0200
Subject: [PATCH 9/9] Updated repay function

---
 contracts/flashloan/base/FlashLoanReceiverBase.sol |  2 +-
 contracts/lendingpool/LendingPool.sol              |  6 ++++--
 contracts/libraries/logic/ValidationLogic.sol      | 12 ++++++------
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/contracts/flashloan/base/FlashLoanReceiverBase.sol b/contracts/flashloan/base/FlashLoanReceiverBase.sol
index 9bccc014..c4aaecd6 100644
--- a/contracts/flashloan/base/FlashLoanReceiverBase.sol
+++ b/contracts/flashloan/base/FlashLoanReceiverBase.sol
@@ -20,7 +20,7 @@ abstract contract FlashLoanReceiverBase is IFlashLoanReceiver {
 
   receive() external payable {}
 
-  function transferFundsBackInternal(
+  function _transferFundsBack(
     address reserve,
     address destination,
     uint256 amount
diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol
index d51f2e2a..bfbe9546 100644
--- a/contracts/lendingpool/LendingPool.sol
+++ b/contracts/lendingpool/LendingPool.sol
@@ -239,12 +239,14 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable, ILendingPool {
   ) external override nonReentrant {
     ReserveLogic.ReserveData storage reserve = _reserves[asset];
 
+    (uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebt(_onBehalfOf, reserve);
+
     ReserveLogic.InterestRateMode rateMode = ReserveLogic.InterestRateMode(_rateMode);
     
     //default to max amount
     uint256 paybackAmount = rateMode == ReserveLogic.InterestRateMode.STABLE
-      ? IERC20(reserve.stableDebtTokenAddress).balanceOf(_onBehalfOf)
-      : IERC20(reserve.variableDebtTokenAddress).balanceOf(_onBehalfOf);
+      ? stableDebt
+      : variableDebt;
 
     if (amount != UINT_MAX_VALUE && amount < paybackAmount) {
       paybackAmount = amount;
diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol
index b7b16ddd..abba4592 100644
--- a/contracts/libraries/logic/ValidationLogic.sol
+++ b/contracts/libraries/logic/ValidationLogic.sol
@@ -217,16 +217,16 @@ library ValidationLogic {
    * @param reserve the reserve state from which the user is repaying
    * @param amountSent the amount sent for the repayment. Can be an actual value or uint(-1)
    * @param onBehalfOf the address of the user msg.sender is repaying for
-   * @param stableBorrowBalance the borrow balance of the user
-   * @param variableBorrowBalance the borrow balance of the user
+   * @param stableDebt the borrow balance of the user
+   * @param variableDebt the borrow balance of the user
    */
   function validateRepay(
     ReserveLogic.ReserveData storage reserve,
     uint256 amountSent,
     ReserveLogic.InterestRateMode rateMode,
     address onBehalfOf,
-    uint256 stableBorrowBalance,
-    uint256 variableBorrowBalance
+    uint256 stableDebt,
+    uint256 variableDebt
   ) external view {
     bool isActive = reserve.configuration.getActive();
 
@@ -235,9 +235,9 @@ library ValidationLogic {
     require(amountSent > 0, 'Amount must be greater than 0');
 
     require(
-      (stableBorrowBalance > 0 &&
+      (stableDebt > 0 &&
         ReserveLogic.InterestRateMode(rateMode) == ReserveLogic.InterestRateMode.STABLE) ||
-        (variableBorrowBalance > 0 &&
+        (variableDebt > 0 &&
           ReserveLogic.InterestRateMode(rateMode) == ReserveLogic.InterestRateMode.VARIABLE),
       '16'
     );