Skip to content

Error codes

Itamar Reif edited this page Nov 12, 2021 · 1 revision

CToken error codes

Error code Message Description
CT_INSUFFICIENT_SUPPLY Insufficient supply Not enough tokens on the market
CT_INSUFFICIENT_BALANCE Insufficient balance Not enough tokens on user's balance
CT_INVALID_LIQUIDATOR Liquidator must be different from borrower Couldn't liquidate own borrow
CT_ZERO_REPAY Repay amount is zero Repat amount should be provided
CT_TRANSFER_NOT_APPROVED Transfer is not approved Sender is not approved to transfer from the given account
CT_UNSAFE_ALLOWANCE_CHANGE Couldn't approve the second time It is unsafe to give the second approval
CT_SENDER_NOT_IRM Sender should be interest rate model An attempt to update rates by third-party
CT_SEIZE_SENDER Seize is allowed only to comptroller An attempt to perform seize by third-party
CT_INVALID_REPAY Repay amount is too high for liquidation Liquidator may not repay more than what is allowed by the closeFactor
CT_INVALID_RESERVE_FACTOR New reserve factor is too high Check newReserveFactorMantissa ≤ maxReserveFactorMantissa is not passed
CT_INVALID_BORROW_RATE New borrow rate is too high Check borrowRateMantissa ≤ borrowRateMaxMantissa is not passed
CT_REDUCE_AMOUNT Reduce amount is bigger than total reserves Reduce reserves validation failed, reduceAmount > totalReserves
CT_INSUFFICIENT_CASH Protocol has insufficient cash Not enough cash to perform an operation
CT_BLOCK_LEVEL Market's block number should be equal to current block number An attempt to perform an operation without accruing the interest
CT_SWEEP_XTZ Mutez sweep is not allowed for CXTZ The sweep is available only for accidentally sent assets, that different from the underlying
CT_SWEEP_UNDERLYING Sweep is not allowed for the underlying token The sweep is available only for accidentally sent assets, that different from the underlying
CT_INVALID_CASH_SENDER Only underlying token can set cash The wrong token is used to set the cash
CT_INVALID_CASH_DATA Received cash data is invalid Received cash data doesn't correspond to underlying token
CT_INVALID_MUTEZ The amount of transferred mutez is invalid The amount of received mutez is different from specified
CT_INTERNAL_CALL The function should not be used as an internal callback Attempt to call the function in the callback of another contract function
CT_INTERNAL_FUNCTION Internal function An attempt to call the internal function by external sender
CT_NOT_ADMIN Sender must be administrator The function is restricted to admin only
CT_NOT_PENDING_ADMIN Sender must be pending admin The sender of a function should be a pending admin, set by a current admin
CT_NOT_SET_PENDING_ADMIN Pending administrator hasn't been set Current admin should set a pending one
CT_INTEREST_INVALID Accrued interest is already invalid The operation requires a preliminary call of accrueInterest()
CT_INTEREST_OLD Accrued interest is too old The operation requires a preliminary call of accrueInterest()

Comptroller error codes

Error code Message Description
CMPT_MARKET_JOINED Already joined to the market User attempts to join market second time
CMPT_BORROW_IN_MARKET The sender has a borrow balance User attempts to exit a market having borrow
CMPT_MINT_PAUSED Mint is paused The mint() is paused for the specified CToken
CMPT_BORROW_PAUSED Borrow is paused The borrow() is paused for the specified CToken
CMPT_TRANSFER_PAUSED Transfer is paused The transfer() is paused by admin
CMPT_SEIZE_PAUSED Seize is paused The ability to seize tokens is paused by admin
CMPT_REDEEMER_SHORTFALL The redeemer shouldn't have shortfall Shortfall appears when borrows exceed collaterals
CMPT_INVALID_BORROW_SENDER Sender must be cToken Only cTokens may call borrowAllowed if borrower not in market
CMPT_INVALID_PRICE CToken's price is invalid The price of CToken should be > 0
CMPT_NO_SHORTFALL The borrower must have a shortfall in order to be liquidatable Shortfall appears when borrows exceed collaterals
CMPT_INVALID_SEIZE_SENDER Seize should be initiated by CToken An attempt to perform seize by third-party
CMPT_UPDATE_PRICE Asset price was not updated The price should be updated on the current level
CMPT_MARKET_NOT_EXISTS Market not exists An attempt to access nonexistent market
CMPT_MARKET_NOT_LISTED Market not listed An attempt to access not listed market
CMPT_MARKET_ALREADY_LISTED Market already listed An attempt to list market that was already listed
CMPT_INTERNAL_FUNCTION Internal function An attempt to call the internal function by external sender
CMPT_NOT_ADMIN Sender must be administrator The function is restricted to admin only
CMPT_NOT_PENDING_ADMIN Sender must be pending admin The sender of a function should be a pending admin, set by a current admin
CMPT_NOT_SET_PENDING_ADMIN Pending administrator hasn't been set Current admin should set a pending one
CMPT_LIQUIDITY_ABSENT Liquidity for the given account is not found The operation requires a preliminary call of updateAccountLiquidity()
CMPT_LIQUIDITY_INVALID Liquidity is already invalid The operation requires a preliminary call of updateAccountLiquidity()
CMPT_LIQUIDITY_OLD Liquidity is too old The operation requires a preliminary call of updateAccountLiquidity()

Governance error codes

Error code Message Description
GOV_NOT_ADMIN Sender must be administrator The function is restricted to admin only
GOV_NOT_PENDING_ADMIN Sender must be pending admin The sender of a function should be a pending admin, set by a current admin
GOV_NOT_SET_PENDING_ADMIN Pending administrator hasn't been set Current admin should set a pending one

Interest rate model error codes

Error code Message Description
IRM_INSUFFICIENT_CASH Insufficient cash Couldn't compute utilization rate due to insufficient cash

Math error codes

Error code Message Description
DIVISION_BY_ZERO Division by zero Invalid divisor
SUBTRACTION_UNDERFLOW Subtraction underflow The result of subtraction is a negative number, but a natural number is expected

Operation protector error codes

Error code Message Description
OP_IN_PROGRESS Could not start new operation while previous is active Attempt to start new operation while previous was not finished. If active operation stuck, perform hardResetOp()
OP_NOT_ACTIVE The required operation is not active Attempt to perform part of an operation in wrong order

Clone this wiki locally