Skip to content

Commit

Permalink
fix: Error library
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Jan 25, 2022
1 parent ffd99a7 commit 475eb1d
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 138 deletions.
137 changes: 68 additions & 69 deletions contracts/protocol/libraries/helpers/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,73 +25,72 @@ library Errors {
string public constant EMODE_CATEGORY_RESERVED = '16'; // 'Zero eMode category is reserved for volatile heterogeneous assets'
string public constant INVALID_EMODE_CATEGORY_ASSIGNMENT = '17'; // 'Invalid eMode category assignment to asset'
string public constant RESERVE_LIQUIDITY_NOT_ZERO = '18'; // 'The liquidity of the reserve needs to be 0'
string public constant FLASHLOAN_PREMIUMS_MISMATCH = '19'; // 'Flashloan total premium should be equal or greater than flashloan premium to protocol'
string public constant FLASHLOAN_PREMIUM_INVALID = '20'; // 'Invalid flashloan premium'
string public constant INVALID_RESERVE_PARAMS = '21'; // 'Invalid risk parameters for the reserve'
string public constant INVALID_EMODE_CATEGORY_PARAMS = '22'; // 'Invalid risk parameters for the eMode category'
string public constant BRIDGE_PROTOCOL_FEE_INVALID = '23'; // 'Invalid bridge protocol fee'
string public constant CALLER_MUST_BE_POOL = '24'; // 'The caller of this function must be a pool'
string public constant INVALID_MINT_AMOUNT = '25'; // 'Invalid amount to mint'
string public constant INVALID_BURN_AMOUNT = '26'; // 'Invalid amount to burn'
string public constant INVALID_AMOUNT = '27'; // 'Amount must be greater than 0'
string public constant RESERVE_INACTIVE = '28'; // 'Action requires an active reserve'
string public constant RESERVE_FROZEN = '29'; // 'Action cannot be performed because the reserve is frozen'
string public constant RESERVE_PAUSED = '30'; // 'Action cannot be performed because the reserve is paused'
string public constant BORROWING_NOT_ENABLED = '31'; // 'Borrowing is not enabled'
string public constant STABLE_BORROWING_NOT_ENABLED = '32'; // 'Stable borrowing is not enabled'
string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '33'; // 'User cannot withdraw more than the available balance'
string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '34'; // 'Invalid interest rate mode selected'
string public constant COLLATERAL_BALANCE_IS_ZERO = '35'; // 'The collateral balance is 0'
string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '36'; // 'Health factor is lesser than the liquidation threshold'
string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '37'; // 'There is not enough collateral to cover a new borrow'
string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '38'; // 'Collateral is (mostly) the same currency that is being borrowed'
string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '39'; // 'The requested amount is greater than the max loan size in stable rate mode'
string public constant NO_DEBT_OF_SELECTED_TYPE = '40'; // 'For repayment of a specific type of debt, the user needs to have debt that type'
string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '41'; // 'To repay on behalf of a user an explicit amount to repay is needed'
string public constant NO_OUTSTANDING_STABLE_DEBT = '42'; // 'User does not have outstanding stable rate debt on this reserve'
string public constant NO_OUTSTANDING_VARIABLE_DEBT = '43'; // 'User does not have outstanding variable rate debt on this reserve'
string public constant UNDERLYING_BALANCE_ZERO = '44'; // 'The underlying balance needs to be greater than 0'
string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '45'; // 'Interest rate rebalance conditions were not met'
string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '46'; // 'Health factor is not below the threshold'
string public constant COLLATERAL_CANNOT_BE_LIQUIDATED = '47'; // 'The collateral chosen cannot be liquidated'
string public constant SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = '48'; // 'User did not borrow the specified currency'
string public constant SAME_BLOCK_BORROW_REPAY = '49'; // 'Borrow and repay in same block is not allowed'
string public constant INCONSISTENT_FLASHLOAN_PARAMS = '50'; // 'Inconsistent flashloan parameters'
string public constant BORROW_CAP_EXCEEDED = '51'; // 'Borrow cap is exceeded'
string public constant SUPPLY_CAP_EXCEEDED = '52'; // 'Supply cap is exceeded'
string public constant UNBACKED_MINT_CAP_EXCEEDED = '53'; // 'Unbacked mint cap is exceeded'
string public constant DEBT_CEILING_EXCEEDED = '54'; // 'Debt ceiling is exceeded'
string public constant ATOKEN_SUPPLY_NOT_ZERO = '55'; // 'AToken supply is not zero'
string public constant STABLE_DEBT_NOT_ZERO = '56'; // 'Stable debt supply is not zero'
string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '57'; // 'Variable debt supply is not zero'
string public constant LTV_VALIDATION_FAILED = '58'; // 'Ltv validation failed'
string public constant INCONSISTENT_EMODE_CATEGORY = '59'; // 'Inconsistent eMode category'
string public constant PRICE_ORACLE_SENTINEL_CHECK_FAILED = '60'; // 'Price oracle sentinel validation failed'
string public constant ASSET_NOT_BORROWABLE_IN_ISOLATION = '61'; // 'Asset is not borrowable in isolation mode'
string public constant RESERVE_ALREADY_INITIALIZED = '62'; // 'Reserve has already been initialized'
string public constant USER_IN_ISOLATION_MODE = '63'; // 'User is in isolation mode'
string public constant INVALID_LTV = '64'; // 'Invalid ltv parameter for the reserve'
string public constant INVALID_LIQ_THRESHOLD = '65'; // 'Invalid liquidity threshold parameter for the reserve'
string public constant INVALID_LIQ_BONUS = '66'; // 'Invalid liquidity bonus parameter for the reserve'
string public constant INVALID_DECIMALS = '67'; // 'Invalid decimals parameter of the underlying asset of the reserve'
string public constant INVALID_RESERVE_FACTOR = '68'; // 'Invalid reserve factor parameter for the reserve'
string public constant INVALID_BORROW_CAP = '69'; // 'Invalid borrow cap for the reserve'
string public constant INVALID_SUPPLY_CAP = '70'; // 'Invalid supply cap for the reserve'
string public constant INVALID_LIQUIDATION_PROTOCOL_FEE = '71'; // 'Invalid liquidation protocol fee for the reserve'
string public constant INVALID_EMODE_CATEGORY = '72'; // 'Invalid eMode category for the reserve'
string public constant INVALID_UNBACKED_MINT_CAP = '73'; // 'Invalid unbacked mint cap for the reserve'
string public constant INVALID_DEBT_CEILING = '74'; // 'Invalid debt ceiling for the reserve
string public constant INVALID_RESERVE_INDEX = '75'; // 'Invalid reserve index'
string public constant ACL_ADMIN_CANNOT_BE_ZERO = '76'; // 'ACL admin cannot be set to the zero address'
string public constant INCONSISTENT_PARAMS_LENGTH = '77'; // 'Array parameters that should be equal length are not'
string public constant ZERO_ADDRESS_NOT_VALID = '78'; // 'Zero address not valid'
string public constant INVALID_EXPIRATION = '79'; // 'Invalid expiration'
string public constant INVALID_SIGNATURE = '80'; // 'Invalid signature'
string public constant OPERATION_NOT_SUPPORTED = '81'; // 'Operation not supported'
string public constant DEBT_CEILING_NOT_ZERO = '82'; // 'Debt ceiling is not zero'
string public constant ASSET_NOT_LISTED = '83'; // 'Asset is not listed'
string public constant INVALID_OPTIMAL_USAGE_RATIO = '84'; // 'Invalid optimal usage ratio'
string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '85'; // 'Invalid optimal stable to total debt ratio'
string public constant UNDERLYING_CANNOT_BE_RESCUED = '86'; // 'The underlying asset cannot be rescued'
string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '87'; // 'Reserve has already been added to reserve list'
string public constant FLASHLOAN_PREMIUM_INVALID = '19'; // 'Invalid flashloan premium'
string public constant INVALID_RESERVE_PARAMS = '20'; // 'Invalid risk parameters for the reserve'
string public constant INVALID_EMODE_CATEGORY_PARAMS = '21'; // 'Invalid risk parameters for the eMode category'
string public constant BRIDGE_PROTOCOL_FEE_INVALID = '22'; // 'Invalid bridge protocol fee'
string public constant CALLER_MUST_BE_POOL = '23'; // 'The caller of this function must be a pool'
string public constant INVALID_MINT_AMOUNT = '24'; // 'Invalid amount to mint'
string public constant INVALID_BURN_AMOUNT = '25'; // 'Invalid amount to burn'
string public constant INVALID_AMOUNT = '26'; // 'Amount must be greater than 0'
string public constant RESERVE_INACTIVE = '27'; // 'Action requires an active reserve'
string public constant RESERVE_FROZEN = '28'; // 'Action cannot be performed because the reserve is frozen'
string public constant RESERVE_PAUSED = '29'; // 'Action cannot be performed because the reserve is paused'
string public constant BORROWING_NOT_ENABLED = '30'; // 'Borrowing is not enabled'
string public constant STABLE_BORROWING_NOT_ENABLED = '31'; // 'Stable borrowing is not enabled'
string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = '32'; // 'User cannot withdraw more than the available balance'
string public constant INVALID_INTEREST_RATE_MODE_SELECTED = '33'; // 'Invalid interest rate mode selected'
string public constant COLLATERAL_BALANCE_IS_ZERO = '34'; // 'The collateral balance is 0'
string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '35'; // 'Health factor is lesser than the liquidation threshold'
string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = '36'; // 'There is not enough collateral to cover a new borrow'
string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = '37'; // 'Collateral is (mostly) the same currency that is being borrowed'
string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '38'; // 'The requested amount is greater than the max loan size in stable rate mode'
string public constant NO_DEBT_OF_SELECTED_TYPE = '39'; // 'For repayment of a specific type of debt, the user needs to have debt that type'
string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '40'; // 'To repay on behalf of a user an explicit amount to repay is needed'
string public constant NO_OUTSTANDING_STABLE_DEBT = '41'; // 'User does not have outstanding stable rate debt on this reserve'
string public constant NO_OUTSTANDING_VARIABLE_DEBT = '42'; // 'User does not have outstanding variable rate debt on this reserve'
string public constant UNDERLYING_BALANCE_ZERO = '43'; // 'The underlying balance needs to be greater than 0'
string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '44'; // 'Interest rate rebalance conditions were not met'
string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '45'; // 'Health factor is not below the threshold'
string public constant COLLATERAL_CANNOT_BE_LIQUIDATED = '46'; // 'The collateral chosen cannot be liquidated'
string public constant SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = '47'; // 'User did not borrow the specified currency'
string public constant SAME_BLOCK_BORROW_REPAY = '48'; // 'Borrow and repay in same block is not allowed'
string public constant INCONSISTENT_FLASHLOAN_PARAMS = '49'; // 'Inconsistent flashloan parameters'
string public constant BORROW_CAP_EXCEEDED = '50'; // 'Borrow cap is exceeded'
string public constant SUPPLY_CAP_EXCEEDED = '51'; // 'Supply cap is exceeded'
string public constant UNBACKED_MINT_CAP_EXCEEDED = '52'; // 'Unbacked mint cap is exceeded'
string public constant DEBT_CEILING_EXCEEDED = '53'; // 'Debt ceiling is exceeded'
string public constant ATOKEN_SUPPLY_NOT_ZERO = '54'; // 'AToken supply is not zero'
string public constant STABLE_DEBT_NOT_ZERO = '55'; // 'Stable debt supply is not zero'
string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = '56'; // 'Variable debt supply is not zero'
string public constant LTV_VALIDATION_FAILED = '57'; // 'Ltv validation failed'
string public constant INCONSISTENT_EMODE_CATEGORY = '58'; // 'Inconsistent eMode category'
string public constant PRICE_ORACLE_SENTINEL_CHECK_FAILED = '59'; // 'Price oracle sentinel validation failed'
string public constant ASSET_NOT_BORROWABLE_IN_ISOLATION = '60'; // 'Asset is not borrowable in isolation mode'
string public constant RESERVE_ALREADY_INITIALIZED = '61'; // 'Reserve has already been initialized'
string public constant USER_IN_ISOLATION_MODE = '62'; // 'User is in isolation mode'
string public constant INVALID_LTV = '63'; // 'Invalid ltv parameter for the reserve'
string public constant INVALID_LIQ_THRESHOLD = '64'; // 'Invalid liquidity threshold parameter for the reserve'
string public constant INVALID_LIQ_BONUS = '65'; // 'Invalid liquidity bonus parameter for the reserve'
string public constant INVALID_DECIMALS = '66'; // 'Invalid decimals parameter of the underlying asset of the reserve'
string public constant INVALID_RESERVE_FACTOR = '67'; // 'Invalid reserve factor parameter for the reserve'
string public constant INVALID_BORROW_CAP = '68'; // 'Invalid borrow cap for the reserve'
string public constant INVALID_SUPPLY_CAP = '69'; // 'Invalid supply cap for the reserve'
string public constant INVALID_LIQUIDATION_PROTOCOL_FEE = '70'; // 'Invalid liquidation protocol fee for the reserve'
string public constant INVALID_EMODE_CATEGORY = '71'; // 'Invalid eMode category for the reserve'
string public constant INVALID_UNBACKED_MINT_CAP = '72'; // 'Invalid unbacked mint cap for the reserve'
string public constant INVALID_DEBT_CEILING = '73'; // 'Invalid debt ceiling for the reserve
string public constant INVALID_RESERVE_INDEX = '74'; // 'Invalid reserve index'
string public constant ACL_ADMIN_CANNOT_BE_ZERO = '75'; // 'ACL admin cannot be set to the zero address'
string public constant INCONSISTENT_PARAMS_LENGTH = '76'; // 'Array parameters that should be equal length are not'
string public constant ZERO_ADDRESS_NOT_VALID = '77'; // 'Zero address not valid'
string public constant INVALID_EXPIRATION = '78'; // 'Invalid expiration'
string public constant INVALID_SIGNATURE = '79'; // 'Invalid signature'
string public constant OPERATION_NOT_SUPPORTED = '80'; // 'Operation not supported'
string public constant DEBT_CEILING_NOT_ZERO = '81'; // 'Debt ceiling is not zero'
string public constant ASSET_NOT_LISTED = '82'; // 'Asset is not listed'
string public constant INVALID_OPTIMAL_USAGE_RATIO = '83'; // 'Invalid optimal usage ratio'
string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = '84'; // 'Invalid optimal stable to total debt ratio'
string public constant UNDERLYING_CANNOT_BE_RESCUED = '85'; // 'The underlying asset cannot be rescued'
string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = '86'; // 'Reserve has already been added to reserve list'
}
Loading

0 comments on commit 475eb1d

Please sign in to comment.