Skip to main content

Overview

Decodes revert reasons from failed Cronos transactions and provides human-readable explanations. Tool Name: decode_transaction_error

Parameters

tx_hash
string
required
Transaction hash (0x… with 64 hex characters)
chain
enum
default:"evm"
Chain to queryOptions: "evm", "zkEvm"

Response

{
  "transaction": {
    "hash": "0xabc123...",
    "chain": "Cronos EVM",
    "status": "FAILED",
    "from": "0x123...",
    "to": "0x456...",
    "protocol": "VVS Finance (DEX)",
    "timestamp": "2026-01-23T03:11:54.000Z",
    "block_number": 12345678
  },
  "error": {
    "type": "STANDARD_ERROR",
    "signature": "0x08c379a0",
    "name": "Error",
    "raw_message": "0x08c379a0...",
    "decoded_message": "Insufficient output amount",
    "explanation": "The swap would result in less tokens than your slippage tolerance allows",
    "suggested_fix": "Increase your slippage tolerance or split the trade into smaller amounts",
    "protocol_docs": "https://docs.vvs.finance/trading"
  },
  "gas_analysis": {
    "gas_used": 150000,
    "gas_limit": 200000,
    "gas_price_gwei": "5000.00",
    "wasted_cro": "0.750000",
    "utilization_percent": 75.0
  },
  "context": {
    "method": "swapExactTokensForTokens",
    "input_data_length": 196,
    "value_cro": "0.000000"
  }
}

Supported Error Types

Error(string) - Standard Solidity error with decoded messageCommon causes:
  • Insufficient balance
  • Slippage exceeded
  • Unauthorized access
  • Invalid parameters

Example Usage

Python (MCP Client)

result = use_mcp_tool(
    server_name="cato",
    tool_name="decode_transaction_error",
    arguments={
        "tx_hash": "0xabc123...",
        "chain": "evm"
    }
)

Natural Language Query

"Why did this transaction fail: 0xabc123..."

"Decode the error for transaction 0xdef456... on zkEVM"

"What went wrong with my swap transaction?"

Response Fields

Transaction Object

FieldTypeDescription
hashstringTransaction hash
chainstringChain name
statusstringTransaction status
fromstringSender address
tostringRecipient address
protocolstringDetected protocol
timestampstringTransaction timestamp
block_numbernumberBlock number

Error Object

FieldTypeDescription
typestringError type
signaturestringError signature
namestringError name
raw_messagestringRaw error data
decoded_messagestringHuman-readable message
explanationstringPlain English explanation
suggested_fixstringHow to fix the issue
protocol_docsstringRelevant documentation

Gas Analysis Object

FieldTypeDescription
gas_usednumberGas consumed
gas_limitnumberGas limit set
gas_price_gweistringGas price in Gwei
wasted_crostringCRO wasted on failed tx
utilization_percentnumberGas utilization %

Common Errors & Solutions

Cause: Slippage tolerance too low for market conditionsSolution:
  • Increase slippage tolerance in DEX settings
  • Split large trades into smaller amounts
  • Wait for better market conditions
Cause: Trying to send more tokens than you haveSolution:
  • Check token balance
  • Account for existing approvals
  • Verify token decimals
Cause: Contract not approved to spend tokensSolution:
  • Call approve() on token contract
  • Set allowance to desired amount
  • Use max approval for convenience
Cause: Gas limit set too lowSolution:
  • Increase gas limit by 20-30%
  • Use gas estimation tools
  • Check for infinite loops in contract
Cause: Gas price below network minimumSolution:
  • Use current network gas price
  • Check gas price oracle
  • Wait for lower network congestion

Gas Analysis Features

Cost Calculation

Calculate exact CRO wasted on failed transaction

Utilization %

See how much of gas limit was used

Price Tracking

Record gas price at transaction time

Optimization Tips

Get suggestions for better gas usage

Protocol Detection

The tool automatically identifies the protocol you’re interacting with:
  • Tectonic - Lending protocol
  • VVS Finance - DEX
  • Fulcrom - Perpetuals
  • Token Contracts - ERC-20 transfers
  • NFT Contracts - ERC-721/1155
  • Custom Contracts - Generic smart contracts
Protocol-specific errors include links to relevant documentation for troubleshooting.

Use Cases

Debug smart contract interactions during development and testing.

Error Handling

Transaction Not Found

{
  "content": [
    {
      "type": "text",
      "text": "{\"error\": \"Transaction not found\"}"
    }
  ],
  "isError": true
}
Solution: Verify transaction hash and chain parameter

RPC Timeout

If RPC times out (>5s), you’ll receive a timeout error with retry suggestion.

Best Practices

1

Check Transaction Status

Always verify the transaction failed before decoding
2

Select Correct Chain

Ensure you’re querying the right chain (EVM vs zkEVM)
3

Review Gas Analysis

Check if out-of-gas was the issue before diving into error details
4

Follow Suggested Fixes

Apply the suggested fixes before retrying
5

Consult Documentation

Review protocol documentation links for complex errors

query_cronos_sdk_docs

Find code examples for proper implementation

Transaction History

View all transactions for an address