Solidity Debug
[AUTO-INVOKE] MUST be invoked when debugging failed on-chain transactions. Covers transaction receipt analysis, gas diagnosis, calldata decoding, revert reason extraction, and state verification using cast. Trigger: any task involving failed tx analysis, revert debugging, or on-chain transaction troubleshooting.
Install
npx skills add NeverSight/learn-skills.dev --skill solidity-debuggit clone --depth 1 https://github.com/NeverSight/learn-skills.dev.git /tmp/learn-skills.dev
mkdir -p ~/.claude/skills
cp -r /tmp/learn-skills.dev/data/skills-md/0xlayerghost/solidity-agent-kit/solidity-debug ~/.claude/skills/solidity-debugPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Failed Transaction Debug Workflow (cast) ## Language Rule - **Always respond in the same language the user is using.** If the user asks in Chinese, respond in Chinese. If in English, respond in English. ## Step 1: 获取交易回执 — 判断成功/失败 ```bash source .env cast receipt <tx_hash> --rpc-url $RPC_URL ``` **关注字段:** | 字段 | 含义 | |------|------| | `status` | 0 = 失败, 1 = 成功 | | `gasUsed` | 实际消耗的 gas | | `logs` | 空数组 `[]` = 交易 revert,无事件发出 | | `to` | 目标合约地址 | ## Step 2: 获取交易详情 — 拿到 gas limit 和 input ```bash cast tx <tx_hash> --rpc-url $RPC_URL ``` **关注字段:** | 字段 | 含义 | |------|------| | `gas` | 发送方设置的 gas limit | | `input` | 调用的 calldata(函数选择器 + 参数编码) | | `from` / `to` | 发送方和目标合约 | | `value` | 发送的原生代币数量 | ## Step 3: 判断失败类型 — gasUsed vs gas limit | 现象 | 判断 | 解决方向 | |------|------|---------| | gasUsed / gas ≈ 100%(如 999,472 / 1,000,000) | **Out of Gas (OOG)** | 提高 gas limit 或用 eth_estimateGas | | gasUsed 远低于 gas limit(如 50,000 / 1,000,000) | **Revert** | 需获取 revert reason,见 Step 6 | | gasUsed 正常但 status=0 | **内部调用失败** | 检查余额、授权、内部 call 返回值 | | 交易根本没上链 | **Nonce/Gas Price 问题** | 检查 pending 队列 | ## Step 4: 解码函数选择器 — 确定调用了什么函数 ```bash # 从 input 的前 4 字节查函数签名 cast 4byte 0xb51a038a # 输出示例: unstake(uint256,address[],uint256[]) ``` ## Step 5: 解码完整 calldata — 还原调用参数 ```bash # 用 Step 4 得到的函数签名解码 cast calldata-decode "unstake(uint256,address[],uint256[])" <完整input_data> ``` 解码后的参数可用于: - 分析入参是否有误 - 直接用于重试交易 ## Step 6: 获取 Revert Reason(非 OOG 场景)
Details
- Skill name
solidity-debug- Repository
- NeverSight/learn-skills.dev
- Path
data/skills-md/0xlayerghost/solidity-agent-kit/solidity-debug/SKILL.md- Repo updated
- 18 November 2026
FAQ
What does the Solidity Debug skill do?
[AUTO-INVOKE] MUST be invoked when debugging failed on-chain transactions. Covers transaction receipt analysis, gas diagnosis, calldata decoding, revert reason extraction, and state verification using cast. Trigger: any task involving failed tx analysis, revert debugging, or on-chain transaction troubleshooting.
How do I install the Solidity Debug skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add NeverSight/learn-skills.dev --skill solidity-debug. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Solidity Debug popular?
It lives in NeverSight/learn-skills.dev, which has 223 GitHub stars and 42 forks.
Related skills
Council
223NeverSight/learn-skills.dev
Convene the Council of High Intelligence — multi-persona deliberation with historical thinkers for deeper analysis of complex problems.
Megaeth Developer
223NeverSight/learn-skills.dev
End-to-end MegaETH development playbook (Feb 2026). Covers wallet operations, token swaps (Kyber Network), eth_sendRawTransactionSync (EIP-7966) for instant receipts, JSON-RPC batching, real-time mini-block subscriptions, storage-aware contract patterns (Solady RedBlackTreeLib), MegaEVM gas model, WebSocket keepalive, bridging from Ethereum, and debugging with mega-evme. Use when building on MegaETH, managing wallets, sending transactions, or deploying contracts.
Openclaw Stock Skill
223NeverSight/learn-skills.dev
使用 data.diemeng.chat 提供的接口查询股票日线、分钟线、财务指标等数据,支持 A 股等市场。
Solidity Security
223NeverSight/learn-skills.dev
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any Solidity contract (.sol files). Covers private key handling, access control, reentrancy prevention, gas safety, and pre-audit checklists. Trigger: any task involving creating, editing, or reviewing .sol source files.
Solidity Coding
223NeverSight/learn-skills.dev
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any Solidity contract (.sol files). Covers pragma version, naming conventions, project layout, OpenZeppelin library selection standards, Chainlink integration, and anti-patterns. Trigger: any task involving creating, editing, or reviewing .sol source files.
Solidity Testing
223NeverSight/learn-skills.dev
[AUTO-INVOKE] MUST be invoked BEFORE writing or modifying any test files (*.t.sol). Covers test structure, naming conventions, coverage requirements, fuzz testing, and Foundry cheatcodes. Trigger: any task involving creating, editing, or running Solidity tests.
Browse the most popular Claude skills, all finance & crypto skills, or write your own with the skills generator.