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
| Code | Name | Meaning |
|---|---|---|
| 1 | CALLER_NOT_POOL_ADMIN | Caller is not a pool admin. |
| 2 | CALLER_NOT_EMERGENCY_ADMIN | Caller is not an emergency admin. |
| 3 | CALLER_NOT_POOL_OR_EMERGENCY_ADMIN | Caller is neither a pool nor an emergency admin. |
| 4 | CALLER_NOT_RISK_OR_POOL_ADMIN | Caller is neither a risk nor a pool admin. |
| 5 | CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN | Caller is neither an asset-listing admin nor a pool admin. |
| 6 | CALLER_NOT_BRIDGE | Caller does not hold BRIDGE_ROLE. |
| 7 | ADDRESSES_PROVIDER_NOT_REGISTERED | Pool addresses provider is not registered with the registry. |
| 8 | INVALID_ADDRESSES_PROVIDER_ID | Invalid id for the pool addresses provider. |
| 9 | NOT_CONTRACT | Address is not a contract. |
| 10 | CALLER_NOT_POOL_CONFIGURATOR | Caller is not the PoolConfigurator. |
| 11 | CALLER_NOT_ATOKEN | Caller is not an AToken. |
| 12 | INVALID_ADDRESSES_PROVIDER | Provider address is invalid. |
| 13 | INVALID_FLASHLOAN_EXECUTOR_RETURN | executeOperation returned false. |
| 14 | RESERVE_ALREADY_ADDED | Reserve has already been added. |
| 15 | NO_MORE_RESERVES_ALLOWED | Reserve list is at MAX_NUMBER_RESERVES = 128. |
| 16 | EMODE_CATEGORY_RESERVED | Category 0 is reserved. |
| 17 | INVALID_EMODE_CATEGORY_ASSIGNMENT | Invalid e-mode category assignment to asset. |
| 18 | RESERVE_LIQUIDITY_NOT_ZERO | Reserve liquidity must be zero for this action. |
| 19 | FLASHLOAN_PREMIUM_INVALID | Flash-loan premium is invalid. |
| 20 | INVALID_RESERVE_PARAMS | Invalid risk parameters for the reserve. |
| 21 | INVALID_EMODE_CATEGORY_PARAMS | Invalid e-mode category parameters. |
| 22 | BRIDGE_PROTOCOL_FEE_INVALID | Invalid bridge protocol fee. |
| 23 | CALLER_MUST_BE_POOL | Caller of this token method must be Pool. |
| 24 | INVALID_MINT_AMOUNT | Invalid amount to mint. |
| 25 | INVALID_BURN_AMOUNT | Invalid amount to burn. |
| 26 | INVALID_AMOUNT | Amount must be greater than zero. |
| 27 | RESERVE_INACTIVE | Reserve must be active. |
| 28 | RESERVE_FROZEN | Reserve is frozen. |
| 29 | RESERVE_PAUSED | Reserve is paused. |
| 30 | BORROWING_NOT_ENABLED | Borrowing is not enabled. |
| 31 | STABLE_BORROWING_NOT_ENABLED | Stable-rate borrowing is not enabled. |
| 32 | NOT_ENOUGH_AVAILABLE_USER_BALANCE | User cannot withdraw more than available. |
| 33 | INVALID_INTEREST_RATE_MODE_SELECTED | Invalid interest-rate mode. |
| 34 | COLLATERAL_BALANCE_IS_ZERO | Collateral balance is zero. |
| 35 | HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD | Operation would drop HF below HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1e18. |
| 36 | COLLATERAL_CANNOT_COVER_NEW_BORROW | Not enough collateral to cover the new borrow. |
| 37 | COLLATERAL_SAME_AS_BORROWING_CURRENCY | Collateral and borrow currency overlap (stable-mode constraint). |
| 38 | AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE | Stable-mode borrow exceeds MAX_STABLE_RATE_BORROW_SIZE_PERCENT. |
| 39 | NO_DEBT_OF_SELECTED_TYPE | No debt of the selected interest-rate mode to repay. |
| 40 | NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF | type(uint256).max may only be passed when repaying for msg.sender. |
| 41 | NO_OUTSTANDING_STABLE_DEBT | User has no outstanding stable-rate debt. |
| 42 | NO_OUTSTANDING_VARIABLE_DEBT | User has no outstanding variable-rate debt. |
| 43 | UNDERLYING_BALANCE_ZERO | Underlying balance is zero. |
| 44 | INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET | Stable-rate rebalance conditions not satisfied. |
| 45 | HEALTH_FACTOR_NOT_BELOW_THRESHOLD | Cannot liquidate: HF is at or above 1e18. |
| 46 | COLLATERAL_CANNOT_BE_LIQUIDATED | Collateral asset cannot be liquidated. |
| 47 | SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER | User did not borrow the specified currency. |
| 49 | INCONSISTENT_FLASHLOAN_PARAMS | assets.length != amounts.length in flashLoan. |
| 50 | BORROW_CAP_EXCEEDED | Borrow cap exceeded. |
| 51 | SUPPLY_CAP_EXCEEDED | Supply cap exceeded. |
| 52 | UNBACKED_MINT_CAP_EXCEEDED | Unbacked mint cap exceeded. |
| 53 | DEBT_CEILING_EXCEEDED | Isolation-mode debt ceiling exceeded. |
| 54 | UNDERLYING_CLAIMABLE_RIGHTS_NOT_ZERO | Cannot drop the reserve: AToken supply or accruedToTreasury is non-zero. |
| 55 | STABLE_DEBT_NOT_ZERO | Stable debt supply must be zero. |
| 56 | VARIABLE_DEBT_SUPPLY_NOT_ZERO | Variable debt supply must be zero. |
| 57 | LTV_VALIDATION_FAILED | LTV validation failed. |
| 58 | INCONSISTENT_EMODE_CATEGORY | E-mode category mismatch. |
| 59 | PRICE_ORACLE_SENTINEL_CHECK_FAILED | Sentinel rejected the action. |
| 60 | ASSET_NOT_BORROWABLE_IN_ISOLATION | Asset is not borrowable in isolation mode. |
| 61 | RESERVE_ALREADY_INITIALIZED | Reserve already initialised. |
| 62 | USER_IN_ISOLATION_MODE_OR_LTV_ZERO | User is in isolation mode or the asset has zero LTV — cannot enable as collateral. |
| 63 | INVALID_LTV | Invalid LTV. |
| 64 | INVALID_LIQ_THRESHOLD | Invalid liquidation threshold. |
| 65 | INVALID_LIQ_BONUS | Invalid liquidation bonus. |
| 66 | INVALID_DECIMALS | Invalid decimals. |
| 67 | INVALID_RESERVE_FACTOR | Invalid reserve factor. |
| 68 | INVALID_BORROW_CAP | Invalid borrow cap. |
| 69 | INVALID_SUPPLY_CAP | Invalid supply cap. |
| 70 | INVALID_LIQUIDATION_PROTOCOL_FEE | Invalid liquidation protocol fee. |
| 71 | INVALID_EMODE_CATEGORY | Invalid e-mode category. |
| 72 | INVALID_UNBACKED_MINT_CAP | Invalid unbacked mint cap. |
| 73 | INVALID_DEBT_CEILING | Invalid debt ceiling. |
| 74 | INVALID_RESERVE_INDEX | Invalid reserve index. |
| 75 | ACL_ADMIN_CANNOT_BE_ZERO | ACL admin cannot be zero. |
| 76 | INCONSISTENT_PARAMS_LENGTH | Array length mismatch. |
| 77 | ZERO_ADDRESS_NOT_VALID | Zero address not permitted. |
| 78 | INVALID_EXPIRATION | Permit deadline expired. |
| 79 | INVALID_SIGNATURE | Permit signature invalid. |
| 80 | OPERATION_NOT_SUPPORTED | Operation not supported (e.g. transfer on a debt token). |
| 81 | DEBT_CEILING_NOT_ZERO | Debt ceiling must be zero for this action. |
| 82 | ASSET_NOT_LISTED | Asset is not listed. |
| 83 | INVALID_OPTIMAL_USAGE_RATIO | Invalid optimal usage ratio. |
| 84 | INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO | Invalid optimal stable/total debt ratio. |
| 85 | UNDERLYING_CANNOT_BE_RESCUED | The underlying asset of an AToken cannot be rescued. |
| 86 | ADDRESSES_PROVIDER_ALREADY_ADDED | Provider already registered. |
| 87 | POOL_ADDRESSES_DO_NOT_MATCH | Token implementation's pool reference does not match the initialising pool. |
| 88 | STABLE_BORROWING_ENABLED | Stable-rate borrowing is currently enabled — disable it before this action. |
| 89 | SILOED_BORROWING_VIOLATION | User is trying to borrow alongside a siloed asset. |
| 90 | RESERVE_DEBT_NOT_ZERO | Reserve total debt must be zero for this action. |
| 91 | FLASHLOAN_DISABLED | Flash-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.