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
- Detect Language - Identify contract language(s) from file extensions and syntax
- Use Tooling (if available) - For Solidity, check if Slither is available and use it
- Locate Contracts - Find all contract/module files (apply directory filter if specified)
- Extract Entry Points - Parse each file for externally callable, state-changing functions
- Classify Access - Categorize each function by access level
- 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 each state-changing entry point into one of these categories:
1. Public (Unrestricted)
Functions with no caller-identity or role restriction. Record state conditions such as pause
flags separately; they do not make a function privileged.
2. Role-Restricted
Functions limited to specific roles. Common patterns to detect:
- Explicit role names:
admin, owner, governance, guardian, operator, manager, minter, pauser, keeper, relayer, lender, borrower
- Role-checking patterns:
onlyRole, hasRole, require(msg.sender == X), assert_owner, #[access_control]
- When role is ambiguous, flag as "Restricted (review required)" with the restriction pattern noted
3. Contract-Only (Internal Integration Points)
Functions whose enforced caller restrictions limit them to other contracts. Cite
the actual check and the identity or provenance of the permitted caller. A
callback name, implemented interface, or intended integration is not access control.
- A callback without caller checks is Public (Unrestricted).
- A check against a configured address is Restricted (Review Required) if its
identity is unresolved; use Contract-Only when that address is established as
the integration contract.
msg.sender != tx.origin establishes a call-path condition, not authentication
of a trusted protocol. Record that condition without inferring a trusted caller.
Output Format
Generate a markdown report with this structure:
# Entry Point Analysis: [Project Name]
**Analyzed**: [timestamp]
**Scope**: [directories analyzed or "full codebase"]
**Languages**: [detected languages]
**Focus**: State-changing functions only (view/pure excluded)
## Summary
| Category | Count |
|----------|-------|
| Public (Unrestricted) | X |
| Role-Restricted | X |
| Restricted (Review Required) | X |
| Contract-Only | X |
| **Total** | **X** |
---
## Public Entry Points (Unrestricted)
State-changing functions callable by anyone—prioritize for attack surface analysis.
| Function | File | Notes |
|----------|------|-------|
| `functionName(params)` | `path/to/file.sol:L42` | Brief note if relevant |
---
## Role-Restricted Entry Points
### Admin / Owner
| Function | File | Restriction |
|----------|------|-------------|
| `setFee(uint256)` | `Config.sol:L15` | `onlyOwner` |
### Governance
| Function | File | Restriction |
|----------|------|-------------|
### Guardian / Pauser
| Function | File | Restriction |
|----------|------|-------------|
### Other Roles
| Function | File | Restriction | Role |
|----------|------|-------------|------|
---
## Restricted (Review Required)
Functions with access control patterns that need manual verification.
| Function | File | Pattern | Why Review |
|----------|------|---------|------------|
| `execute(bytes)` | `Executor.sol:L88` | `require(trusted[msg.sender])` | Dynamic trust list |
---
## Contract-Only (Internal Integration Points)
Functions only callable by other contracts—useful for understanding trust boundaries.
| Function | File | Expected Caller |
|----------|------|-----------------|
| `onFlashLoan(...)` | `Vault.sol:L200` | Flash loan provider |
---
## Files Analyzed
- `path/to/file1.sol` (X state-changing entry points)
- `path/to/file2.sol` (X state-changing entry points)
Filtering
When user specifies a directory filter:
- Only analyze files within that path
- Note the filter in the report header
- Example: "Analyze only
src/core/" → scope = src/core/
Analysis Guidelines
- Be thorough: Don't skip files. Every state-changing externally callable function matters.
- Be conservative: When uncertain about access level, flag for review rather than miscategorize.
- Skip read-only: Exclude
view, pure, and equivalent read-only functions.
- Note inheritance: If a function's access control comes from a parent contract, note this.
- Track modifiers: List all access-related modifiers/decorators applied to each function.
- Identify patterns: Look for common patterns like:
- Initializer functions (often unrestricted on first call)
- Upgrade functions (high-privilege)
- Emergency/pause functions (guardian-level)
- Fee/parameter setters (admin-level)
- Token transfers and approvals (often public)
Common Role Patterns by Protocol Type
| Protocol Type |
Common Roles |
| DEX |
owner, feeManager, pairCreator |
| Lending |
admin, guardian, liquidator, oracle |
| Governance |
proposer, executor, canceller, timelock |
| NFT |
minter, admin, royaltyReceiver |
| Bridge |
relayer, guardian, validator, operator |
| Vault/Yield |
strategist, keeper, harvester, manager |
Rationalizations to Reject
When analyzing entry points, reject these shortcuts:
- "This function looks standard" → Still classify it; standard functions can have non-standard access control
- "The modifier name is clear" → Verify the modifier's actual implementation
- "This is obviously admin-only" → Trace the actual restriction; "obvious" assumptions miss subtle bypasses
- "I'll skip the callbacks" → Callbacks define trust boundaries; always include them
- "It doesn't modify much state" → Any state change can be exploited; include all non-view functions
Error Handling
If a file cannot be parsed:
- Note it in the report under "Analysis Warnings"
- Continue with remaining files
- Suggest manual review for unparsable files
1---2name: entry-point-analyzer3description: 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.4metadata:5 source: https://skillmd.com/skills/trailofbits/entry-point-analyzer6---78# Entry Point Analyzer910Systematically identify all **state-changing** entry points in a smart contract codebase to guide security audits.1112## Execution in Codex1314Use the available file-reading, search, and shell tools. Resolve bundled reference15links relative to this SKILL.md, not the audited repository. Slither is optional;16use manual inspection if it is unavailable or fails. Report unreadable source or17reference files as coverage gaps. Runtime permissions come from the workspace.1819## When to Use2021Use this skill when:22- Starting a smart contract security audit to map the attack surface23- Asked to find entry points, external functions, or audit flows24- Analyzing access control patterns across a codebase25- Identifying privileged operations and role-restricted functions26- Building an understanding of which functions can modify contract state2728## When NOT to Use2930Do NOT use this skill for:31- Vulnerability detection (use audit-context-building or domain-specific-audits)32- Writing exploit POCs (use solidity-poc-builder)33- Code quality or gas optimization analysis34- Non-smart-contract codebases35- Analyzing read-only functions (this skill excludes them)3637## Scope: State-Changing Functions Only3839This skill focuses exclusively on functions that can modify state. **Excluded:**4041| Language | Excluded Patterns |42|----------|-------------------|43| Solidity | `view`, `pure` functions |44| Vyper | `@view`, `@pure` functions |45| Solana | Functions without `mut` account references |46| Move | Read-only function bodies; visibility alone does not establish mutability |47| TON | `get` methods (FunC), read-only receivers (Tact) |48| CosmWasm | `query` entry point and its handlers |4950Include state-changing Move `public fun` even without `entry`: Aptos transaction51scripts and Sui programmable transaction blocks can reach them. Trace callees when52needed to determine state effects, and record signer, capability, and object53ownership requirements separately from visibility.5455**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.5657## Workflow58591. **Detect Language** - Identify contract language(s) from file extensions and syntax602. **Use Tooling (if available)** - For Solidity, check if Slither is available and use it613. **Locate Contracts** - Find all contract/module files (apply directory filter if specified)624. **Extract Entry Points** - Parse each file for externally callable, state-changing functions635. **Classify Access** - Categorize each function by access level646. **Generate Report** - Output structured markdown report6566## Slither Integration (Solidity)6768For Solidity codebases, Slither can automatically extract entry points. Before manual analysis:6970### 1. Check if Slither is Available7172```bash73which slither74```7576### 2. If Slither is Detected, Run Entry Points Printer7778```bash79slither . --print entry-points80```8182This outputs a table of all state-changing entry points with:83- Contract name84- Function name85- Visibility86- Modifiers applied8788### 3. Use Slither Output as Foundation8990- Parse the Slither output table to populate your analysis91- Cross-reference with manual inspection for access control classification92- Slither may miss some patterns (callbacks, dynamic access control)—supplement with manual review93- If Slither fails (compilation errors, unsupported features), fall back to manual analysis9495### 4. When Slither is NOT Available9697If `which slither` returns nothing, proceed with manual analysis using the language-specific reference files.9899## Language Detection100101| Extension | Language | Reference |102|-----------|----------|-----------|103| `.sol` | Solidity | [references/solidity.md](references/solidity.md) |104| `.vy` | Vyper | [references/vyper.md](references/vyper.md) |105| `.rs` + `Cargo.toml` with `solana-program` | Solana (Rust) | [references/solana.md](references/solana.md) |106| `.move` + `Move.toml` with `edition` | Move (Sui) | [references/move-sui.md](references/move-sui.md) |107| `.move` + `Move.toml` with `Aptos` | Move (Aptos) | [references/move-aptos.md](references/move-aptos.md) |108| `.fc`, `.func`, `.tact` | TON (FunC/Tact) | [references/ton.md](references/ton.md) |109| `.rs` + `Cargo.toml` with `cosmwasm-std` | CosmWasm | [references/cosmwasm.md](references/cosmwasm.md) |110111Load the appropriate reference file(s) based on detected language before analysis.112113## Access Classification114115Classify each state-changing entry point into one of these categories:116117### 1. Public (Unrestricted)118Functions with no caller-identity or role restriction. Record state conditions such as pause119flags separately; they do not make a function privileged.120121### 2. Role-Restricted122Functions limited to specific roles. Common patterns to detect:123- Explicit role names: `admin`, `owner`, `governance`, `guardian`, `operator`, `manager`, `minter`, `pauser`, `keeper`, `relayer`, `lender`, `borrower`124- Role-checking patterns: `onlyRole`, `hasRole`, `require(msg.sender == X)`, `assert_owner`, `#[access_control]`125- When role is ambiguous, flag as **"Restricted (review required)"** with the restriction pattern noted126127### 3. Contract-Only (Internal Integration Points)128Functions whose enforced caller restrictions limit them to other contracts. Cite129the actual check and the identity or provenance of the permitted caller. A130callback name, implemented interface, or intended integration is not access control.131132- A callback without caller checks is **Public (Unrestricted)**.133- A check against a configured address is **Restricted (Review Required)** if its134 identity is unresolved; use **Contract-Only** when that address is established as135 the integration contract.136- `msg.sender != tx.origin` establishes a call-path condition, not authentication137 of a trusted protocol. Record that condition without inferring a trusted caller.138139## Output Format140141Generate a markdown report with this structure:142143```markdown144# Entry Point Analysis: [Project Name]145146**Analyzed**: [timestamp]147**Scope**: [directories analyzed or "full codebase"]148**Languages**: [detected languages]149**Focus**: State-changing functions only (view/pure excluded)150151## Summary152153| Category | Count |154|----------|-------|155| Public (Unrestricted) | X |156| Role-Restricted | X |157| Restricted (Review Required) | X |158| Contract-Only | X |159| **Total** | **X** |160161---162163## Public Entry Points (Unrestricted)164165State-changing functions callable by anyone—prioritize for attack surface analysis.166167| Function | File | Notes |168|----------|------|-------|169| `functionName(params)` | `path/to/file.sol:L42` | Brief note if relevant |170171---172173## Role-Restricted Entry Points174175### Admin / Owner176| Function | File | Restriction |177|----------|------|-------------|178| `setFee(uint256)` | `Config.sol:L15` | `onlyOwner` |179180### Governance181| Function | File | Restriction |182|----------|------|-------------|183184### Guardian / Pauser185| Function | File | Restriction |186|----------|------|-------------|187188### Other Roles189| Function | File | Restriction | Role |190|----------|------|-------------|------|191192---193194## Restricted (Review Required)195196Functions with access control patterns that need manual verification.197198| Function | File | Pattern | Why Review |199|----------|------|---------|------------|200| `execute(bytes)` | `Executor.sol:L88` | `require(trusted[msg.sender])` | Dynamic trust list |201202---203204## Contract-Only (Internal Integration Points)205206Functions only callable by other contracts—useful for understanding trust boundaries.207208| Function | File | Expected Caller |209|----------|------|-----------------|210| `onFlashLoan(...)` | `Vault.sol:L200` | Flash loan provider |211212---213214## Files Analyzed215216- `path/to/file1.sol` (X state-changing entry points)217- `path/to/file2.sol` (X state-changing entry points)218```219220## Filtering221222When user specifies a directory filter:223- Only analyze files within that path224- Note the filter in the report header225- Example: "Analyze only `src/core/`" → scope = `src/core/`226227## Analysis Guidelines2282291. **Be thorough**: Don't skip files. Every state-changing externally callable function matters.2302. **Be conservative**: When uncertain about access level, flag for review rather than miscategorize.2313. **Skip read-only**: Exclude `view`, `pure`, and equivalent read-only functions.2324. **Note inheritance**: If a function's access control comes from a parent contract, note this.2335. **Track modifiers**: List all access-related modifiers/decorators applied to each function.2346. **Identify patterns**: Look for common patterns like:235 - Initializer functions (often unrestricted on first call)236 - Upgrade functions (high-privilege)237 - Emergency/pause functions (guardian-level)238 - Fee/parameter setters (admin-level)239 - Token transfers and approvals (often public)240241## Common Role Patterns by Protocol Type242243| Protocol Type | Common Roles |244|---------------|--------------|245| DEX | `owner`, `feeManager`, `pairCreator` |246| Lending | `admin`, `guardian`, `liquidator`, `oracle` |247| Governance | `proposer`, `executor`, `canceller`, `timelock` |248| NFT | `minter`, `admin`, `royaltyReceiver` |249| Bridge | `relayer`, `guardian`, `validator`, `operator` |250| Vault/Yield | `strategist`, `keeper`, `harvester`, `manager` |251252## Rationalizations to Reject253254When analyzing entry points, reject these shortcuts:255- "This function looks standard" → Still classify it; standard functions can have non-standard access control256- "The modifier name is clear" → Verify the modifier's actual implementation257- "This is obviously admin-only" → Trace the actual restriction; "obvious" assumptions miss subtle bypasses258- "I'll skip the callbacks" → Callbacks define trust boundaries; always include them259- "It doesn't modify much state" → Any state change can be exploited; include all non-view functions260261## Error Handling262263If a file cannot be parsed:2641. Note it in the report under "Analysis Warnings"2652. Continue with remaining files2663. Suggest manual review for unparsable files