From 4a6517dce1d8759ac9c88f3bcf02807feb0c21bc Mon Sep 17 00:00:00 2001 From: David Racero Date: Mon, 14 Sep 2020 13:17:06 +0200 Subject: [PATCH] Inherit Pausable from LendingPoolLiquidationManager to match same storage layout as LendingPool. --- .../LendingPoolLiquidationManager.sol | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/contracts/lendingpool/LendingPoolLiquidationManager.sol b/contracts/lendingpool/LendingPoolLiquidationManager.sol index 3f393107..30d94796 100644 --- a/contracts/lendingpool/LendingPoolLiquidationManager.sol +++ b/contracts/lendingpool/LendingPoolLiquidationManager.sol @@ -3,6 +3,7 @@ pragma solidity ^0.6.8; import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol'; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import {Pausable} from '@openzeppelin/contracts/utils/Pausable.sol'; import { VersionedInitializable } from '../libraries/openzeppelin-upgradeability/VersionedInitializable.sol'; @@ -26,8 +27,9 @@ import {Errors} from '../libraries/helpers/Errors.sol'; * @title LendingPoolLiquidationManager contract * @author Aave * @notice Implements the liquidation function. + * @dev LendingPoolLiquidationManager inherits Pausable from OpenZeppelin to have the same storage layout as LendingPool **/ -contract LendingPoolLiquidationManager is VersionedInitializable { +contract LendingPoolLiquidationManager is VersionedInitializable, Pausable { using SafeERC20 for IERC20; using SafeMath for uint256; using WadRayMath for uint256; @@ -271,7 +273,12 @@ contract LendingPoolLiquidationManager is VersionedInitializable { ); //burn the equivalent amount of atoken - vars.collateralAtoken.burn(user, msg.sender, vars.maxCollateralToLiquidate, collateralReserve.liquidityIndex); + vars.collateralAtoken.burn( + user, + msg.sender, + vars.maxCollateralToLiquidate, + collateralReserve.liquidityIndex + ); } //transfers the principal currency to the aToken @@ -391,7 +398,12 @@ contract LendingPoolLiquidationManager is VersionedInitializable { //updating collateral reserve indexes collateralReserve.updateCumulativeIndexesAndTimestamp(); - vars.collateralAtoken.burn(user, receiver, vars.maxCollateralToLiquidate, collateralReserve.liquidityIndex); + vars.collateralAtoken.burn( + user, + receiver, + vars.maxCollateralToLiquidate, + collateralReserve.liquidityIndex + ); if (vars.userCollateralBalance == vars.maxCollateralToLiquidate) { usersConfig[user].setUsingAsCollateral(collateralReserve.id, false);