positional arguments: {safe-functions,analyze,a,disassemble,d,foundry,f,list-detectors,read-storage,function-to-hash,hash-to-address,version,help} Commands safe-functions Check functionswhich are completely safe using symbolic execution analyze (a) Triggers the analysis of the smart contract # 分析智能合约 disassemble (d) Disassembles the smart contract # 拆解合约,返回合约对应的字节码 foundry (f) Triggers the analysis of the smart contract list-detectors Lists available detection modules # 列出可用的安全检测模型 read-storage Retrieves storage slots from a given address through rpc function-to-hash Returns the hash signature of the function hash-to-address converts the hashes in the blockchain to ethereum address version Outputs the version
options: -h, --help show this help message and exit -v LOG_LEVEL log level (0-5)
Slither
概述
Slither 是用python 3编写的智能合约静态分析框架提供如下功能:
自动化漏洞检测。
自动优化检测。
代码理解。绘制合约的继承拓扑图,合约方法调用关系图,帮助开发者理解代码。
辅助代码审查。
运行流程
合约源码经过solc编译后得到 AST 作为 Slither 的输入。
通过 information recovery, Slither 生成合约的继承图,控制流图(CFG)以及合约中函数列表。