Error Messages

This document provides a list of error messages, along with their explanations, that integrators may encounter when working with the Unizen API. These error messages are designed to provide detailed information about the specific issues that may arise during trading. It is important for integrators to understand these error messages in order to effectively handle and communicate them to users.

Additionally, these error messages are also meant to be displayed to users when they encounter issues while using our application. By providing clear and informative error messages, we aim to assist users in understanding the cause of the problem and guide them towards potential solutions or actions to take.

We believe that transparent and user-friendly error messages are crucial for a seamless user experience. By addressing potential errors proactively and providing meaningful explanations, we strive to enhance user confidence and satisfaction with our application.

  1. Trade call issue with external DEX: This error occurs when there is an issue while calling an external DEX to trade. It can happen due to various reasons, such as the rate changing, the DEX stopping trading, the DEX changing the function being called, or the DEX killing their contract.

  2. Return amount is not enough: Trade amount lower than expected. This error occurs when the amount returned after the trade execution on the chain is lower than the expected amount.

  3. Insufficient contract allowance or disallowed data. This error occurs when the user hasn't approved enough allowance to our trade smart contract or when the token contract doesn't allow the call with data.

  4. Not enough funds for the transaction. This error occurs when there are insufficient funds available for sending the transaction.

  5. Gas limit exceeded or contract issues. This error can occur in situations such as when the exact gas limit is exceeded during trading, when the contract has been upgraded but the frontend/sdk has not been updated, or when sending a transaction to the wrong contract address.

  6. Trade amount is 0. This error occurs when the trade amount specified is zero.

  7. Trade on an unapproved DEX. This error occurs when attempting to trade at a DEX that hasn't been whitelisted yet.

  8. No data provided to the contract. This error occurs when no data is passed to the contract.

  9. Insufficient native currency sent. This error occurs when the user trades using the native currency but doesn't send enough amount to the contract.

  10. ERC20 token amount is 0. This error occurs when the user trades with an ERC20 token, but the amount specified is 0.

  11. Incorrect receiver address. This error occurs when the receiver address specified in the trade information is either address(0) or doesn't match the user address or our contract address.

  12. Sender and user addresses must match. This error occurs when the sender and user addresses specified are not the same, which is done to prevent hacking attempts from other contracts.

  13. Negative trade amount after execution. This error occurs when trading exactIn, and after the trade execution, the amount in the contract becomes less than 0.

  14. Cross-chain pool not added yet. This error occurs when a user trades cross-chain, but the pool from Stargate has not been added yet.

  15. Destination chain address not set. This error occurs when a user trades cross-chain and the address of our application on the destination chain has not been set yet. Sending assets to address(0) on the destination chain will result in the loss of funds forever.

Last updated