diff --git a/contracts/lendingpool/LendingPoolConfigurator.sol b/contracts/lendingpool/LendingPoolConfigurator.sol index b02b11f5..b442ce35 100644 --- a/contracts/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/lendingpool/LendingPoolConfigurator.sol @@ -100,16 +100,16 @@ contract LendingPoolConfigurator is VersionedInitializable { event ReserveDeactivated(address indexed asset); /** - * @dev emitted when a reserve is freezed + * @dev emitted when a reserve is frozen * @param asset the address of the reserve **/ - event ReserveFreezed(address indexed asset); + event ReserveFrozen(address indexed asset); /** - * @dev emitted when a reserve is unfreezed + * @dev emitted when a reserve is unfrozen * @param asset the address of the reserve **/ - event ReserveUnfreezed(address indexed asset); + event ReserveUnfrozen(address indexed asset); /** * @dev emitted when a reserve loan to value is updated @@ -462,7 +462,7 @@ contract LendingPoolConfigurator is VersionedInitializable { } /** - * @dev freezes a reserve. A freezed reserve doesn't accept any new deposit, borrow or rate swap, but can accept repayments, liquidations, rate rebalances and redeems + * @dev freezes a reserve. A frozen reserve doesn't accept any new deposit, borrow or rate swap, but can accept repayments, liquidations, rate rebalances and redeems * @param asset the address of the reserve **/ function freezeReserve(address asset) external onlyAaveAdmin { @@ -472,7 +472,7 @@ contract LendingPoolConfigurator is VersionedInitializable { pool.setConfiguration(asset, currentConfig.data); - emit ReserveFreezed(asset); + emit ReserveFrozen(asset); } /** @@ -486,7 +486,7 @@ contract LendingPoolConfigurator is VersionedInitializable { pool.setConfiguration(asset, currentConfig.data); - emit ReserveUnfreezed(asset); + emit ReserveUnfrozen(asset); } /** diff --git a/contracts/libraries/configuration/ReserveConfiguration.sol b/contracts/libraries/configuration/ReserveConfiguration.sol index fcbafc2b..7951d91a 100644 --- a/contracts/libraries/configuration/ReserveConfiguration.sol +++ b/contracts/libraries/configuration/ReserveConfiguration.sol @@ -259,7 +259,7 @@ library ReserveConfiguration { /** * @dev gets the configuration flags of the reserve * @param self the reserve configuration - * @return the state flags representing active, freezed, borrowing enabled, stableRateBorrowing enabled + * @return the state flags representing active, frozen, borrowing enabled, stableRateBorrowing enabled **/ function getFlags(ReserveConfiguration.Map storage self) internal @@ -336,7 +336,7 @@ library ReserveConfiguration { /** * @dev gets the configuration flags of the reserve from a memory object * @param self the reserve configuration - * @return the state flags representing active, freezed, borrowing enabled, stableRateBorrowing enabled + * @return the state flags representing active, frozen, borrowing enabled, stableRateBorrowing enabled **/ function getFlagsMemory(ReserveConfiguration.Map memory self) internal diff --git a/contracts/libraries/helpers/Errors.sol b/contracts/libraries/helpers/Errors.sol index 7345c5c3..5fcc7cb3 100644 --- a/contracts/libraries/helpers/Errors.sol +++ b/contracts/libraries/helpers/Errors.sol @@ -19,7 +19,7 @@ pragma solidity ^0.6.8; library Errors { string public constant VL_AMOUNT_NOT_GREATER_THAN_0 = '1'; // 'Amount must be greater than 0' string public constant VL_NO_ACTIVE_RESERVE = '2'; // 'Action requires an active reserve' - string public constant VL_NO_UNFREEZED_RESERVE = '3'; // 'Action requires an unfreezed reserve' + string public constant VL_RESERVE_FROZEN = '3'; // 'Action cannot be performed because the reserve is frozen' string public constant VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4'; // 'The current liquidity is not enough' string public constant VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5'; // 'User cannot withdraw more than the available balance' string public constant VL_TRANSFER_NOT_ALLOWED = '6'; // 'Transfer cannot be allowed.' @@ -102,6 +102,6 @@ library Errors { NO_ACTIVE_RESERVE, HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD, INVALID_EQUAL_ASSETS_TO_SWAP, - NO_UNFREEZED_RESERVE + FROZEN_RESERVE } } diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index 657b1d63..29595068 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -34,11 +34,11 @@ library ValidationLogic { * @param amount the amount to be deposited */ function validateDeposit(ReserveLogic.ReserveData storage reserve, uint256 amount) external view { - (bool isActive, bool isFreezed, , ) = reserve.configuration.getFlags(); + (bool isActive, bool isFrozen, , ) = reserve.configuration.getFlags(); require(amount > 0, Errors.VL_AMOUNT_NOT_GREATER_THAN_0); require(isActive, Errors.VL_NO_ACTIVE_RESERVE); - require(!isFreezed, Errors.VL_NO_UNFREEZED_RESERVE); + require(!isFrozen, Errors.VL_RESERVE_FROZEN); } /** @@ -97,7 +97,7 @@ library ValidationLogic { ReserveLogic.InterestRateMode rateMode; bool healthFactorBelowThreshold; bool isActive; - bool isFreezed; + bool isFrozen; bool borrowingEnabled; bool stableRateBorrowingEnabled; } @@ -133,15 +133,12 @@ library ValidationLogic { ) external view { ValidateBorrowLocalVars memory vars; - ( - vars.isActive, - vars.isFreezed, - vars.borrowingEnabled, - vars.stableRateBorrowingEnabled - ) = reserve.configuration.getFlags(); + (vars.isActive, vars.isFrozen, vars.borrowingEnabled, vars.stableRateBorrowingEnabled) = reserve + .configuration + .getFlags(); require(vars.isActive, Errors.VL_NO_ACTIVE_RESERVE); - require(!vars.isFreezed, Errors.VL_NO_UNFREEZED_RESERVE); + require(!vars.isFrozen, Errors.VL_RESERVE_FROZEN); require(vars.borrowingEnabled, Errors.VL_BORROWING_NOT_ENABLED); @@ -266,10 +263,10 @@ library ValidationLogic { uint256 variableDebt, ReserveLogic.InterestRateMode currentRateMode ) external view { - (bool isActive, bool isFreezed, , bool stableRateEnabled) = reserve.configuration.getFlags(); + (bool isActive, bool isFrozen, , bool stableRateEnabled) = reserve.configuration.getFlags(); require(isActive, Errors.VL_NO_ACTIVE_RESERVE); - require(!isFreezed, Errors.VL_NO_UNFREEZED_RESERVE); + require(!isFrozen, Errors.VL_RESERVE_FROZEN); if (currentRateMode == ReserveLogic.InterestRateMode.STABLE) { require(stableDebt > 0, Errors.VL_NO_STABLE_RATE_LOAN_IN_RESERVE); diff --git a/helpers/types.ts b/helpers/types.ts index 8e506fb7..5d5b079d 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -74,7 +74,7 @@ export enum eContractid { export enum ProtocolErrors { VL_AMOUNT_NOT_GREATER_THAN_0 = '1', // 'Amount must be greater than 0' VL_NO_ACTIVE_RESERVE = '2', // 'Action requires an active reserve' - VL_NO_UNFREEZED_RESERVE = '3', // 'Action requires an unfreezed reserve' + VL_RESERVE_FROZEN = '3', // 'Action requires an unfrozen reserve' VL_CURRENT_AVAILABLE_LIQUIDITY_NOT_ENOUGH = '4', // 'The current liquidity is not enough' VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5', // 'User cannot withdraw more than the available balance' VL_TRANSFER_NOT_ALLOWED = '6', // 'Transfer cannot be allowed.'