Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Troubleshooting

Error Codes

SparkLend contracts revert with numeric string codes (e.g. "35") rather than custom errors, in order to minimise contract bytecode. The mapping below is authoritative for the deployed code; the source of truth is contracts/protocol/libraries/helpers/Errors.sol.

Reference

CodeNameMeaning
1CALLER_NOT_POOL_ADMINCaller is not a pool admin.
2CALLER_NOT_EMERGENCY_ADMINCaller is not an emergency admin.
3CALLER_NOT_POOL_OR_EMERGENCY_ADMINCaller is neither a pool nor an emergency admin.
4CALLER_NOT_RISK_OR_POOL_ADMINCaller is neither a risk nor a pool admin.
5CALLER_NOT_ASSET_LISTING_OR_POOL_ADMINCaller is neither an asset-listing admin nor a pool admin.
6CALLER_NOT_BRIDGECaller does not hold BRIDGE_ROLE.
7ADDRESSES_PROVIDER_NOT_REGISTEREDPool addresses provider is not registered with the registry.
8INVALID_ADDRESSES_PROVIDER_IDInvalid id for the pool addresses provider.
9NOT_CONTRACTAddress is not a contract.
10CALLER_NOT_POOL_CONFIGURATORCaller is not the PoolConfigurator.
11CALLER_NOT_ATOKENCaller is not an AToken.
12INVALID_ADDRESSES_PROVIDERProvider address is invalid.
13INVALID_FLASHLOAN_EXECUTOR_RETURNexecuteOperation returned false.
14RESERVE_ALREADY_ADDEDReserve has already been added.
15NO_MORE_RESERVES_ALLOWEDReserve list is at MAX_NUMBER_RESERVES = 128.
16EMODE_CATEGORY_RESERVEDCategory 0 is reserved.
17INVALID_EMODE_CATEGORY_ASSIGNMENTInvalid e-mode category assignment to asset.
18RESERVE_LIQUIDITY_NOT_ZEROReserve liquidity must be zero for this action.
19FLASHLOAN_PREMIUM_INVALIDFlash-loan premium is invalid.
20INVALID_RESERVE_PARAMSInvalid risk parameters for the reserve.
21INVALID_EMODE_CATEGORY_PARAMSInvalid e-mode category parameters.
22BRIDGE_PROTOCOL_FEE_INVALIDInvalid bridge protocol fee.
23CALLER_MUST_BE_POOLCaller of this token method must be Pool.
24INVALID_MINT_AMOUNTInvalid amount to mint.
25INVALID_BURN_AMOUNTInvalid amount to burn.
26INVALID_AMOUNTAmount must be greater than zero.
27RESERVE_INACTIVEReserve must be active.
28RESERVE_FROZENReserve is frozen.
29RESERVE_PAUSEDReserve is paused.
30BORROWING_NOT_ENABLEDBorrowing is not enabled.
31STABLE_BORROWING_NOT_ENABLEDStable-rate borrowing is not enabled.
32NOT_ENOUGH_AVAILABLE_USER_BALANCEUser cannot withdraw more than available.
33INVALID_INTEREST_RATE_MODE_SELECTEDInvalid interest-rate mode.
34COLLATERAL_BALANCE_IS_ZEROCollateral balance is zero.
35HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLDOperation would drop HF below HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1e18.
36COLLATERAL_CANNOT_COVER_NEW_BORROWNot enough collateral to cover the new borrow.
37COLLATERAL_SAME_AS_BORROWING_CURRENCYCollateral and borrow currency overlap (stable-mode constraint).
38AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLEStable-mode borrow exceeds MAX_STABLE_RATE_BORROW_SIZE_PERCENT.
39NO_DEBT_OF_SELECTED_TYPENo debt of the selected interest-rate mode to repay.
40NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALFtype(uint256).max may only be passed when repaying for msg.sender.
41NO_OUTSTANDING_STABLE_DEBTUser has no outstanding stable-rate debt.
42NO_OUTSTANDING_VARIABLE_DEBTUser has no outstanding variable-rate debt.
43UNDERLYING_BALANCE_ZEROUnderlying balance is zero.
44INTEREST_RATE_REBALANCE_CONDITIONS_NOT_METStable-rate rebalance conditions not satisfied.
45HEALTH_FACTOR_NOT_BELOW_THRESHOLDCannot liquidate: HF is at or above 1e18.
46COLLATERAL_CANNOT_BE_LIQUIDATEDCollateral asset cannot be liquidated.
47SPECIFIED_CURRENCY_NOT_BORROWED_BY_USERUser did not borrow the specified currency.
49INCONSISTENT_FLASHLOAN_PARAMSassets.length != amounts.length in flashLoan.
50BORROW_CAP_EXCEEDEDBorrow cap exceeded.
51SUPPLY_CAP_EXCEEDEDSupply cap exceeded.
52UNBACKED_MINT_CAP_EXCEEDEDUnbacked mint cap exceeded.
53DEBT_CEILING_EXCEEDEDIsolation-mode debt ceiling exceeded.
54UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZEROCannot drop the reserve: AToken supply or accruedToTreasury is non-zero.
55STABLE_DEBT_NOT_ZEROStable debt supply must be zero.
56VARIABLE_DEBT_SUPPLY_NOT_ZEROVariable debt supply must be zero.
57LTV_VALIDATION_FAILEDLTV validation failed.
58INCONSISTENT_EMODE_CATEGORYE-mode category mismatch.
59PRICE_ORACLE_SENTINEL_CHECK_FAILEDSentinel rejected the action.
60ASSET_NOT_BORROWABLE_IN_ISOLATIONAsset is not borrowable in isolation mode.
61RESERVE_ALREADY_INITIALIZEDReserve already initialised.
62USER_IN_ISOLATION_MODE_OR_LTV_ZEROUser is in isolation mode or the asset has zero LTV — cannot enable as collateral.
63INVALID_LTVInvalid LTV.
64INVALID_LIQ_THRESHOLDInvalid liquidation threshold.
65INVALID_LIQ_BONUSInvalid liquidation bonus.
66INVALID_DECIMALSInvalid decimals.
67INVALID_RESERVE_FACTORInvalid reserve factor.
68INVALID_BORROW_CAPInvalid borrow cap.
69INVALID_SUPPLY_CAPInvalid supply cap.
70INVALID_LIQUIDATION_PROTOCOL_FEEInvalid liquidation protocol fee.
71INVALID_EMODE_CATEGORYInvalid e-mode category.
72INVALID_UNBACKED_MINT_CAPInvalid unbacked mint cap.
73INVALID_DEBT_CEILINGInvalid debt ceiling.
74INVALID_RESERVE_INDEXInvalid reserve index.
75ACL_ADMIN_CANNOT_BE_ZEROACL admin cannot be zero.
76INCONSISTENT_PARAMS_LENGTHArray length mismatch.
77ZERO_ADDRESS_NOT_VALIDZero address not permitted.
78INVALID_EXPIRATIONPermit deadline expired.
79INVALID_SIGNATUREPermit signature invalid.
80OPERATION_NOT_SUPPORTEDOperation not supported (e.g. transfer on a debt token).
81DEBT_CEILING_NOT_ZERODebt ceiling must be zero for this action.
82ASSET_NOT_LISTEDAsset is not listed.
83INVALID_OPTIMAL_USAGE_RATIOInvalid optimal usage ratio.
84INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIOInvalid optimal stable/total debt ratio.
85UNDERLYING_CANNOT_BE_RESCUEDThe underlying asset of an AToken cannot be rescued.
86ADDRESSES_PROVIDER_ALREADY_ADDEDProvider already registered.
87POOL_ADDRESSES_DO_NOT_MATCHToken implementation's pool reference does not match the initialising pool.
88STABLE_BORROWING_ENABLEDStable-rate borrowing is currently enabled — disable it before this action.
89SILOED_BORROWING_VIOLATIONUser is trying to borrow alongside a siloed asset.
90RESERVE_DEBT_NOT_ZEROReserve total debt must be zero for this action.
91FLASHLOAN_DISABLEDFlash-loan is disabled on this reserve (bit 63 of the reserve configuration).

In addition to the numeric codes, FlashLoanLogic.executeFlashLoan reverts with the string FLASHLOAN_INTO_BORROW_DEPRECATED when called with a non-zero interestRateModes[i] — this is the SparkLend-specific disabling of flash-loan-into-borrow.