一键导入
mvx-debug-tx
Debug and analyze MultiversX transactions. Use when a transaction failed, returned unexpected results, or needs full decoding of inputs/outputs/events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug and analyze MultiversX transactions. Use when a transaction failed, returned unexpected results, or needs full decoding of inputs/outputs/events.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guidelines for establishing context before an audit.
Perform a comprehensive on-chain security audit of a deployed MultiversX smart contract. Use when reviewing a contract's security posture, permissions, state, and economic safety without source code.
Read on-chain state in MultiversX smart contracts. Use when accessing caller info, account balances, block timestamps, ESDT token metadata, local roles, code metadata, or any data from self.blockchain().
Gas-optimized cache patterns for MultiversX smart contracts using Drop-based write-back caches. Use when building contracts that read/write multiple storage values per transaction, DeFi protocols, or any gas-sensitive contract.
Identify ambiguous requirements and ask targeted clarifying questions for MultiversX development. Use when user requests are vague, missing technical constraints, or have conflicting requirements.
Comprehensive code analysis toolkit for MultiversX smart contracts. Covers differential review (version comparison, upgrade safety), fix verification (validate patches, regression testing), and variant analysis (find similar bugs across codebase). Use when reviewing PRs, verifying security patches, or hunting for bug variants.
| name | mvx-debug-tx |
| description | Debug and analyze MultiversX transactions. Use when a transaction failed, returned unexpected results, or needs full decoding of inputs/outputs/events. |
Analyze a transaction to determine what happened, why it failed (if applicable), decode all smart contract outputs, and explain every event. Combines on-chain decoding with local simulation techniques.
Retrieve the complete transaction data from the MultiversX API.
Manual approach: Query the API directly:
GET https://gateway.multiversx.com/transaction/{txHash}?withResults=true
Or use the explorer: https://explorer.multiversx.com/transactions/{txHash}
For devnet/testnet, replace the base URL accordingly (devnet-api.multiversx.com, testnet-api.multiversx.com).
MCP shortcut: If a MultiversX MCP server is available (multiversx-sc-mcp or multiversx-mcp-server), use mvx_tx_result for this step.
Extract and record:
The transaction data field contains the function call. Parse it:
@): function name (plain text ASCII)@-separated components: arguments (hex-encoded)For each argument, determine:
| Position | Hex Value | Decoded Value | Likely Type |
|---|---|---|---|
| arg0 | ... | ... | Address / BigUint / TokenIdentifier / ... |
Decoding tips:
erd1... format4d45582d343535633537 = MEX-455c57)MCP shortcut: If a MultiversX MCP server is available (multiversx-sc-mcp or multiversx-mcp-server), use mvx_sc_decode to decode complex argument types (structs, enums, nested types).
If the transaction includes ESDT transfers (ESDTTransfer, ESDTNFTTransfer, MultiESDTNFTTransfer):
For each smart contract result in the transaction:
@6f6b = @ok (success)@ followed by error code = failure@-separated values = multi-returnBuild a call trace showing the execution flow:
1. Sender -> Contract A: functionName(args...)
1.1 Contract A -> Contract B: innerCall(args...)
Result: [decoded return value]
1.2 Contract A -> Sender: [token transfer / refund]
Result: [ok / error]
If the transaction succeeded and returned data:
@ separatorsMCP shortcut: If a MultiversX MCP server is available (multiversx-sc-mcp or multiversx-mcp-server), use mvx_sc_abi on the receiver address to fetch the ABI, and mvx_sc_decode to decode return values.
If the transaction failed, identify the root cause.
Common failure patterns:
| Error Message | Meaning | Likely Cause |
|---|---|---|
execution failed | SC logic error | require/sc_panic triggered |
out of gas | Insufficient gas | Complex operation or gas limit too low |
user error | Input validation | Wrong arguments, wrong token, insufficient balance |
signal error | SC explicitly signaled | Business logic rejection |
insufficient funds | Not enough EGLD/tokens | Sender balance too low |
invalid arguments | Wrong arg count/type | Mismatched function signature |
action is not allowed | Access control | Caller is not owner/admin |
contract not found | Target not deployed | Wrong address or not yet deployed |
too much gas | Gas limit exceeds block limit | Reduce gas limit |
Common error codes:
10: Execution Failed6: User Rejected4: Invalid BalanceFor SC errors, decode the error message from the result data:
@ prefix and error codeIf the error is not immediately clear:
MCP shortcut: If a MultiversX MCP server is available (multiversx-sc-mcp or multiversx-mcp-server), use mvx_sc_abi to inspect the endpoint, mvx_sc_query to check state, and mvx_account to verify balances.
For each event/log entry in the transaction:
If the contract ABI is available, match events to their definitions to decode topic and data types correctly.
Recognize standard MultiversX events:
ESDTTransfer, ESDTNFTTransfer, MultiESDTNFTTransfer -- token movementsESDTLocalMint / ESDTLocalBurn -- supply changesESDTNFTCreate / ESDTNFTBurn -- NFT lifecyclewriteLog -- generic logscompletedTxEvent -- async completionSCDeploy -- deploymentsignalError -- explicit errorsReconstruct the chronological order of events to tell the full story of the transaction execution.
If the transaction involves cross-shard communication:
When on-chain data is insufficient, reproduce the issue locally.
mx-chain-simulator-goPOST /simulator/set-state to replicate the production state locallysc_print!("Balance: {}", my_balance); to the contract codeCreate a Mandos/scenario test case (repro.scen.json) that reproduces the exact failure with minimal setup. This serves as both a debugging aid and a regression test.
Produce a report with these sections: