跳到正文
Skillpedia
安全8.0k · #12677

entry-point-analyzer

它能做什么

列出智能合约中可以改变其状态的函数,并按允许调用者分类,例如公开、管理员或仅合约可调用。适用于开始审计合约工作的审计人员。

适用场景

  • ✓审计人员开始安全审计、需要梳理合约攻击面的时候。
  • ✓团队想查看合约拥有哪些管理员或角色限制函数的时候。
  • ✓有人想了解合约中哪些函数可以改变其状态的时候。

技能链接

https://github.com/trailofbits/skills/blob/main/plugins/entry-point-analyzer/skills/entry-point-analyzer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/entry-point-analyzer/skills/entry-point-analyzer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请梳理我的智能合约中所有会改变状态的函数,并按调用者分组。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能在代码中搜索可从外部调用、且能改变状态的函数,并跳过只读函数。它按访问级别对其分类,并生成结构化报告。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Entry Point Analyzer

Systematically identify all state-changing entry points in a smart contract codebase to guide security audits.

Execution in Codex

Use the available file-reading, search, and shell tools. Resolve bundled reference links relative to this SKILL.md, not the audited repository. Slither is optional; use manual inspection if it is unavailable or fails. Report unreadable source or reference files as coverage gaps. Runtime permissions come from the workspace.

When to Use

Use this skill when:

  • Starting a smart contract security audit to map the attack surface
  • Asked to find entry points, external functions, or audit flows
  • Analyzing access control patterns across a codebase
  • Identifying privileged operations and role-restricted functions
  • Building an understanding of which functions can modify contract state

When NOT to Use

Do NOT use this skill for:

  • Vulnerability detection (use audit-context-building or domain-specific-audits)
  • Writing exploit POCs (use solidity-poc-builder)
  • Code quality or gas optimization analysis
  • Non-smart-contract codebases
  • Analyzing read-only functions (this skill excludes them)

Scope: State-Changing Functions Only

This skill focuses exclusively on functions that can modify state. Excluded:

Language Excluded Patterns
Solidity view, pure functions
Vyper @view, @pure functions
Solana Functions without mut account references
Move Read-only function bodies; visibility alone does not establish mutability
TON get methods (FunC), read-only receivers (Tact)
CosmWasm query entry point and its handlers

Include state-changing Move public fun even without entry: Aptos transaction scripts and Sui programmable transaction blocks can reach them. Trace callees when needed to determine state effects, and record signer, capability, and object ownership requirements separately from visibility.

Why exclude read-only functions? They cannot directly cause loss of funds or state corruption. While they may leak information, the primary audit focus is on functions that can change state.

Workflow

  1. Detect Language - Identify contract language(s) from file extensions and syntax
  2. Use Tooling (if available) - For Solidity, check if Slither is available and use it
  3. Locate Contracts - Find all contract/module files (apply directory filter if specified)
  4. Extract Entry Points - Parse each file for externally callable, state-changing functions
  5. Classify Access - Categorize each function by access level
  6. Generate Report - Output structured markdown report

Slither Integration (Solidity)

For Solidity codebases, Slither can automatically extract entry points. Before manual analysis:

1. Check if Slither is Available

which slither

2. If Slither is Detected, Run Entry Points Printer

slither . --print entry-points

This outputs a table of all state-changing entry points with:

  • Contract name
  • Function name
  • Visibility
  • Modifiers applied

3. Use Slither Output as Foundation

  • Parse the Slither output table to populate your analysis
  • Cross-reference with manual inspection for access control classification
  • Slither may miss some patterns (callbacks, dynamic access control)—supplement with manual review
  • If Slither fails (compilation errors, unsupported features), fall back to manual analysis

4. When Slither is NOT Available

If which slither returns nothing, proceed with manual analysis using the language-specific reference files.

Language Detection

Extension Language Reference
.sol Solidity references/solidity.md
.vy Vyper references/vyper.md
.rs + Cargo.toml with solana-program Solana (Rust) references/solana.md
.move + Move.toml with edition Move (Sui) references/move-sui.md
.move + Move.toml with Aptos Move (Aptos) references/move-aptos.md
.fc, .func, .tact TON (FunC/Tact) references/ton.md
.rs + Cargo.toml with cosmwasm-std CosmWasm references/cosmwasm.md

Load the appropriate reference file(s) based on detected language before analysis.

Access Classification

Classify ea

常见问题

它会查找漏洞吗?

不会。它梳理的是攻击面。漏洞检测属于另一项审计技能。

它支持哪些语言?

描述列出的包括 Solidity、Vyper、使用 Rust 的 Solana、Move、TON 和 CosmWasm 等。

需要 Slither 吗?

不需要。Slither 是可选的,如果没有它,该技能可以手动阅读代码。

详情

作者的原始描述

Analyzes smart contract codebases to identify state-changing entry points for security auditing. Detects externally callable functions that modify state, categorizes them by access level (public, admin, role-restricted, contract-only), and generates structured audit reports. Excludes view/pure/read-only functions. Use when auditing smart contracts (Solidity, Vyper, Solana/Rust, Move, TON, CosmWasm) or when asked to find entry points, audit flows, external functions, access control patterns, or privileged operations.

repo: trailofbits/skills

热度

GitHub 星标
8.0k
排名
#12677
许可证
CC-BY-SA-4.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能