Changed freezed to frozen

This commit is contained in:
emilio 2020-10-31 13:47:16 +01:00
parent f188fd5c8f
commit 05d426645d
5 changed files with 21 additions and 24 deletions

View File

@ -100,16 +100,16 @@ contract LendingPoolConfigurator is VersionedInitializable {
event ReserveDeactivated(address indexed asset); 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 * @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 * @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 * @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 * @param asset the address of the reserve
**/ **/
function freezeReserve(address asset) external onlyAaveAdmin { function freezeReserve(address asset) external onlyAaveAdmin {
@ -472,7 +472,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
pool.setConfiguration(asset, currentConfig.data); pool.setConfiguration(asset, currentConfig.data);
emit ReserveFreezed(asset); emit ReserveFrozen(asset);
} }
/** /**
@ -486,7 +486,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
pool.setConfiguration(asset, currentConfig.data); pool.setConfiguration(asset, currentConfig.data);
emit ReserveUnfreezed(asset); emit ReserveUnfrozen(asset);
} }
/** /**

View File

@ -259,7 +259,7 @@ library ReserveConfiguration {
/** /**
* @dev gets the configuration flags of the reserve * @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 * @return the state flags representing active, frozen, borrowing enabled, stableRateBorrowing enabled
**/ **/
function getFlags(ReserveConfiguration.Map storage self) function getFlags(ReserveConfiguration.Map storage self)
internal internal
@ -336,7 +336,7 @@ library ReserveConfiguration {
/** /**
* @dev gets the configuration flags of the reserve from a memory object * @dev gets the configuration flags of the reserve from a memory object
* @param self the reserve configuration * @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) function getFlagsMemory(ReserveConfiguration.Map memory self)
internal internal

View File

@ -19,7 +19,7 @@ pragma solidity ^0.6.8;
library Errors { library Errors {
string public constant VL_AMOUNT_NOT_GREATER_THAN_0 = '1'; // 'Amount must be greater than 0' 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_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_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_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.' string public constant VL_TRANSFER_NOT_ALLOWED = '6'; // 'Transfer cannot be allowed.'
@ -102,6 +102,6 @@ library Errors {
NO_ACTIVE_RESERVE, NO_ACTIVE_RESERVE,
HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD, HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD,
INVALID_EQUAL_ASSETS_TO_SWAP, INVALID_EQUAL_ASSETS_TO_SWAP,
NO_UNFREEZED_RESERVE FROZEN_RESERVE
} }
} }

View File

@ -34,11 +34,11 @@ library ValidationLogic {
* @param amount the amount to be deposited * @param amount the amount to be deposited
*/ */
function validateDeposit(ReserveLogic.ReserveData storage reserve, uint256 amount) external view { 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(amount > 0, Errors.VL_AMOUNT_NOT_GREATER_THAN_0);
require(isActive, Errors.VL_NO_ACTIVE_RESERVE); 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; ReserveLogic.InterestRateMode rateMode;
bool healthFactorBelowThreshold; bool healthFactorBelowThreshold;
bool isActive; bool isActive;
bool isFreezed; bool isFrozen;
bool borrowingEnabled; bool borrowingEnabled;
bool stableRateBorrowingEnabled; bool stableRateBorrowingEnabled;
} }
@ -133,15 +133,12 @@ library ValidationLogic {
) external view { ) external view {
ValidateBorrowLocalVars memory vars; ValidateBorrowLocalVars memory vars;
( (vars.isActive, vars.isFrozen, vars.borrowingEnabled, vars.stableRateBorrowingEnabled) = reserve
vars.isActive, .configuration
vars.isFreezed, .getFlags();
vars.borrowingEnabled,
vars.stableRateBorrowingEnabled
) = reserve.configuration.getFlags();
require(vars.isActive, Errors.VL_NO_ACTIVE_RESERVE); 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); require(vars.borrowingEnabled, Errors.VL_BORROWING_NOT_ENABLED);
@ -266,10 +263,10 @@ library ValidationLogic {
uint256 variableDebt, uint256 variableDebt,
ReserveLogic.InterestRateMode currentRateMode ReserveLogic.InterestRateMode currentRateMode
) external view { ) 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(isActive, Errors.VL_NO_ACTIVE_RESERVE);
require(!isFreezed, Errors.VL_NO_UNFREEZED_RESERVE); require(!isFrozen, Errors.VL_RESERVE_FROZEN);
if (currentRateMode == ReserveLogic.InterestRateMode.STABLE) { if (currentRateMode == ReserveLogic.InterestRateMode.STABLE) {
require(stableDebt > 0, Errors.VL_NO_STABLE_RATE_LOAN_IN_RESERVE); require(stableDebt > 0, Errors.VL_NO_STABLE_RATE_LOAN_IN_RESERVE);

View File

@ -74,7 +74,7 @@ export enum eContractid {
export enum ProtocolErrors { export enum ProtocolErrors {
VL_AMOUNT_NOT_GREATER_THAN_0 = '1', // 'Amount must be greater than 0' 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_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_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_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5', // 'User cannot withdraw more than the available balance'
VL_TRANSFER_NOT_ALLOWED = '6', // 'Transfer cannot be allowed.' VL_TRANSFER_NOT_ALLOWED = '6', // 'Transfer cannot be allowed.'