Skylens Transaction Analysis
Use {skillDir}/scripts/skylens.py to inspect one transaction with Skylens APIs.
When To Use This Skill
Use this skill when the user wants transaction-level investigation for a single EVM transaction on a supported chain. Typical triggers:
- - The user provides a transaction hash and asks what happened.
- The user wants an execution trace or call flow for one transaction.
- The user asks which balances changed for a specific address in one transaction.
- The user asks which storage slots changed for a contract in one transaction.
- The user asks whether an address nonce changed in one transaction.
- The user wants contract source files tied to addresses touched by one transaction.
Quick Triage Workflow
- 1. Run
get-trace to identify key calls/contracts. - Run
list-source-files for suspicious contract addresses to enumerate available files. - Run
get-source-file with selected --FILE_INDEX (and optional --OUTPUT) to fetch source code. - Run
state-change for suspicious contract addresses (storage deltas). - Run
nonce-change for addresses that sent/triggered actions. - Run
balance-change for holder asset impact.
Commands
- -
get-trace: readable execution trace (paged) - INLINECODE10 : balance deltas for one holder
- INLINECODE11 : storage slot changes for one address
- INLINECODE12 : nonce before/after for one address
- INLINECODE13 : list contract source files (or AST-only files) by tx
- INLINECODE14 : get one contract file by index from INLINECODE15
Supported Chains
INLINECODE16 , bsc, polygon, optimism, arb, base, blast, avalanche, scroll, linea, sonic, kaia, world, unichain, hyperliquid, INLINECODE31
Shared Parameter Rules
- -
tx_hash: full hash with INLINECODE33 - INLINECODE34 : must be one of supported chains above
- INLINECODE35 /
holder: case-insensitive, accepts with or without INLINECODE37
get-trace
CLI:
INLINECODE39
Output:
- - Prints one readable trace line per event.
- Prints only
[offset, offset+size).
Output format:
INLINECODE41
Source suffix (optional):
INLINECODE42
Current event variants:
- - INLINECODE43
- INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
balance-change
CLI:
INLINECODE49
Output:
- - Prints balance deltas for the target
holder. - May include native/token/NFT sections when available.
Printed shapes:
- - INLINECODE51
- INLINECODE52
- INLINECODE53
state-change
CLI:
INLINECODE55
Output:
- - Prints storage changes for the target
address only.
Printed shape:
INLINECODE57
nonce-change
CLI:
INLINECODE59
Output:
- - Prints nonce before/after for the target
address.
Printed shape:
INLINECODE61
list-source-files
CLI:
INLINECODE63
Output:
- - Lists source files for the target contract.
- Includes file indexes used by
get-source-file.
Printed shape:
- - INLINECODE65
- INLINECODE66
- INLINECODE67
get-source-file
CLI:
INLINECODE69
Output:
- - Returns source content for one selected file index.
- If
--OUTPUT is provided, saves source content to that path.
Skylens 交易分析
使用 {skillDir}/scripts/skylens.py 通过 Skylens API 检查一笔交易。
何时使用此技能
当用户需要对支持链上的单笔 EVM 交易进行交易级调查时使用此技能。典型触发场景:
- - 用户提供交易哈希并询问发生了什么。
- 用户想要一笔交易的执行轨迹或调用流程。
- 用户询问一笔交易中某个特定地址的余额变化。
- 用户询问一笔交易中某个合约的存储槽变化。
- 用户询问一笔交易中某个地址的 nonce 是否变化。
- 用户想要获取与一笔交易涉及的地址相关的合约源文件。
快速分类工作流程
- 1. 运行 get-trace 识别关键调用/合约。
- 对可疑合约地址运行 list-source-files 枚举可用文件。
- 使用选定的 --FILE_INDEX(和可选的 --OUTPUT)运行 get-source-file 获取源代码。
- 对可疑合约地址运行 state-change(存储增量)。
- 对发送/触发操作的地址运行 nonce-change。
- 对持有者资产影响运行 balance-change。
命令
- - get-trace:可读的执行轨迹(分页)
- balance-change:单个持有者的余额增量
- state-change:单个地址的存储槽变化
- nonce-change:单个地址的 nonce 前后值
- list-source-files:按交易列出合约源文件(或仅 AST 文件)
- get-source-file:从 list-source-files 按索引获取单个合约文件
支持的链
eth、bsc、polygon、optimism、arb、base、blast、avalanche、scroll、linea、sonic、kaia、world、unichain、hyperliquid、plasma
共享参数规则
- - tx_hash:带 0x 的完整哈希
- chain:必须是上述支持的链之一
- address / holder:不区分大小写,接受带或不带 0x
get-trace
命令行:
{skillDir}/scripts/skylens.py get-trace --TX --CHAIN --OFFSET 0 --SIZE 100
输出:
- - 每个事件打印一行可读的轨迹。
- 仅打印 [offset, offset+size) 范围。
输出格式:
{index}({depth}) {op} {description} [source: ...]
来源后缀(可选):
source: [c: {contractAddress}, f:{fileIdx}, s:{start}, o:{length}]
当前事件变体:
- - callEvent
- createEvent
- storageAccessEvent
- logEvent
- keccak256Event
balance-change
命令行:
{skillDir}/scripts/skylens.py balance-change --TX --CHAIN --HOLDER
输出:
- - 打印目标 holder 的余额增量。
- 可用时可能包含原生/代币/NFT 部分。
打印格式:
- - BalanceOf Native ETH: holder=... before=... after=... delta=...
- BalanceOf Token: token=... holder=... before=... after=... delta=...
- BalanceOf NFT: collection=... holder=... before=... after=... delta=...
state-change
命令行:
{skillDir}/scripts/skylens.py state-change --TX --CHAIN --ADDRESS
输出:
打印格式:
Storage: address=... slot=0x... before=... after=...
nonce-change
命令行:
{skillDir}/scripts/skylens.py nonce-change --TX --CHAIN --ADDRESS
输出:
- - 打印目标 address 的 nonce 前后值。
打印格式:
Nonce: address=... before=... after=...
list-source-files
命令行:
{skillDir}/scripts/skylens.py list-source-files --TX hash> --CHAIN --ADDRESS address>
输出:
- - 列出目标合约的源文件。
- 包含 get-source-file 使用的文件索引。
打印格式:
- - Contract: ...
- Files: ...
- [index] fileName (artifact=..., available=source|none)
get-source-file
命令行:
{skillDir}/scripts/skylens.py get-source-file --TX hash> --CHAIN --ADDRESS address> --FILEINDEX [--OUTPUT path>]
输出:
- - 返回选定文件索引的源内容。
- 如果提供了 --OUTPUT,则将源内容保存到该路径。