Technical Reference
Error Codes
Below is a reference of error codes that may be returned by the CPMM V2 contracts (Pool, Deposit, and Position).
| Name | Code | Description |
|---|---|---|
NotUninitialized | 20 | Thrown during pool initialization if the pool is not in the Uninitialized state. |
NotInitializing | 21 | Thrown when receiving a wallet resolution notification but the pool is not in the Initializing state. |
NotInitialized | 22 | Thrown when an operation (like swap or withdrawal) is attempted on a pool that hasn't completed initialization. |
SenderUnauthorized | 23 | Thrown when a message is received from an address that does not have the required permissions for the operation. |
WalletCannotBeResolved | 24 | Thrown during TEP-89 discovery if the resolver returns a non-internal address (e.g., addr_none). |
MessageValueTooLow | 25 | Thrown when the attached TON value is insufficient to cover gas, storage fees, or required forward fees. |
DuplicateOfAssets | 26 | Thrown during pool initialization if Asset X and Asset Y are the same. |
UnrelatedAsset | 28 | Thrown when a payment or deposit is made using an asset that is not part of the pool's asset pair. |
ValueTooLow | 29 | Thrown when an amount or value provided in the message is lower than the logic requires. |
SlippageExceeded | 30 | Thrown when the actual output amount or liquidity is less than the minimal_amount_out or minimal_liquidity specified by the user. |
AssetNotSupported | 31 | Thrown when trying to interact with an asset type that the contract logic cannot handle. |
WrongWorkchain | 32 | Thrown when an address (asset root or wallet) is not in the expected workchain (Basechain). |
DeadlineExceeded | 33 | Thrown when a swap or operation is executed after the user-specified deadline timestamp. |
ZeroLiquidity | 34 | Thrown when attempting a swap in a pool that has no liquidity. |
MaxCreatorFeeExceeded | 35 | Thrown during initialization if the creator_fee_bps exceeds the allowed maximum (5000 BPS). |
NotEnoughLiquidity | 36 | Thrown when a position attempts to withdraw more liquidity than it currently holds or more than is available (unlocked). |
SwapNotActive | 37 | Thrown when a swap is attempted but the pool's swap activation conditions (time or initiator) are not yet met. |
DepositNotActive | 38 | Thrown when a deposit is attempted but the pool's deposit activation conditions are not yet met. |
WalletAlreadyRegistered | 39 | Internal error thrown if an attempt is made to register a jetton wallet for an asset that already has one registered. |
WalletNotRegistered | 40 | Thrown when trying to find a jetton wallet for an asset, but it hasn't been discovered/registered yet. |
UnknownResolver | 41 | Thrown during initialization if a wallet resolution is received from an address not expected by the pool. |
RewardIsNotAllowed | 42 | Thrown when attempting to fund or claim a reward asset that is not in the pool's allowed_rewards map. |
MaxRewardDurationExceeded | 43 | Thrown when funding a reward with a duration longer than the maximum allowed duration configured for that reward. |
ZeroDurationReward | 44 | Thrown when attempting to create a new reward distribution with zero duration. |
RewardBudgetDilution | 45 | Thrown when prolonging a reward if the new funding rate would significantly dilute the current reward rate. |
RewardIsNotActive | 46 | Thrown when attempting to interact with a reward index that has no active distribution. |
ZeroInputAmount | 47 | Thrown when a swap or deposit is initiated with an input amount of zero. |
UnknownOperation | 65535 | Thrown when the contract receives a message with an unknown opcode (0xffff). |