Entry Point Analyzer
Systematically identify all state-changing entry points in a smart contract codebase to guide security audits.
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 |
Non-entry public fun (module-callable only) |
| TON |
get methods (FunC), read-only receivers (Tact) |
| CosmWasm |
query entry point and its handlers |
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 |
{baseDir}/references/solidity.md |
.vy |
Vyper |
{baseDir}/references/vyper.md |
.rs + Cargo.toml with solana-program |
Solana (Rust) |
{baseDir}/references/solana.md |
.move + Move.toml with edition |
{baseDir}/references/move-sui.md |
|
.move + Move.toml with Aptos |
{baseDir}/references/move-aptos.md |
|
.fc, .func, .tact |
TON (FunC/Tact) |
{baseDir}/references/ton.md |
.rs + Cargo.toml with cosmwasm-std |
CosmWasm |
{baseDir}/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 callable by anyone without restrictions.
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 callable only by other contracts, not by EOAs. Indicators:
- Callbacks:
onERC721Received, uniswapV3SwapCallback, flashLoanCallback
- Interface implementations with contract-caller checks
- Functions that revert if
tx.origin == msg.sender
- Cross-contract hooks
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
Source: trailofbits/skills → plugins/entry-point-analyzer/skills/entry-point-analyzer/SKILL.md
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.4---567# Entry Point Analyzer89Systematically identify all **state-changing** entry points in a smart contract codebase to guide security audits.1011## When to Use1213Use this skill when:14- Starting a smart contract security audit to map the attack surface15- Asked to find entry points, external functions, or audit flows16- Analyzing access control patterns across a codebase17- Identifying privileged operations and role-restricted functions18- Building an understanding of which functions can modify contract state1920## When NOT to Use2122Do NOT use this skill for:23- Vulnerability detection (use audit-context-building or domain-specific-audits)24- Writing exploit POCs (use solidity-poc-builder)25- Code quality or gas optimization analysis26- Non-smart-contract codebases27- Analyzing read-only functions (this skill excludes them)2829## Scope: State-Changing Functions Only3031This skill focuses exclusively on functions that can modify state. **Excluded:**3233| Language | Excluded Patterns |34|----------|-------------------|35| Solidity | `view`, `pure` functions |36| Vyper | `@view`, `@pure` functions |37| Solana | Functions without `mut` account references |38| Move | Non-entry `public fun` (module-callable only) |39| TON | `get` methods (FunC), read-only receivers (Tact) |40| CosmWasm | `query` entry point and its handlers |4142**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.4344## Workflow45461. **Detect Language** - Identify contract language(s) from file extensions and syntax472. **Use Tooling (if available)** - For Solidity, check if Slither is available and use it483. **Locate Contracts** - Find all contract/module files (apply directory filter if specified)494. **Extract Entry Points** - Parse each file for externally callable, state-changing functions505. **Classify Access** - Categorize each function by access level516. **Generate Report** - Output structured markdown report5253## Slither Integration (Solidity)5455For Solidity codebases, Slither can automatically extract entry points. Before manual analysis:5657### 1. Check if Slither is Available5859```bash60which slither61```6263### 2. If Slither is Detected, Run Entry Points Printer6465```bash66slither . --print entry-points67```6869This outputs a table of all state-changing entry points with:70- Contract name71- Function name72- Visibility73- Modifiers applied7475### 3. Use Slither Output as Foundation7677- Parse the Slither output table to populate your analysis78- Cross-reference with manual inspection for access control classification79- Slither may miss some patterns (callbacks, dynamic access control)—supplement with manual review80- If Slither fails (compilation errors, unsupported features), fall back to manual analysis8182### 4. When Slither is NOT Available8384If `which slither` returns nothing, proceed with manual analysis using the language-specific reference files.8586## Language Detection8788| Extension | Language | Reference |89|-----------|----------|-----------|90| `.sol` | Solidity | [{baseDir}/references/solidity.md]({baseDir}/references/solidity.md) |91| `.vy` | Vyper | [{baseDir}/references/vyper.md]({baseDir}/references/vyper.md) |92| `.rs` + `Cargo.toml` with `solana-program` | Solana (Rust) | [{baseDir}/references/solana.md]({baseDir}/references/solana.md) |93| `.move` + `Move.toml` with `edition` | [{baseDir}/references/move-sui.md]({baseDir}/references/move-sui.md) |94| `.move` + `Move.toml` with `Aptos` | [{baseDir}/references/move-aptos.md]({baseDir}/references/move-aptos.md) |95| `.fc`, `.func`, `.tact` | TON (FunC/Tact) | [{baseDir}/references/ton.md]({baseDir}/references/ton.md) |96| `.rs` + `Cargo.toml` with `cosmwasm-std` | CosmWasm | [{baseDir}/references/cosmwasm.md]({baseDir}/references/cosmwasm.md) |9798Load the appropriate reference file(s) based on detected language before analysis.99100## Access Classification101102Classify each state-changing entry point into one of these categories:103104### 1. Public (Unrestricted)105Functions callable by anyone without restrictions.106107### 2. Role-Restricted108Functions limited to specific roles. Common patterns to detect:109- Explicit role names: `admin`, `owner`, `governance`, `guardian`, `operator`, `manager`, `minter`, `pauser`, `keeper`, `relayer`, `lender`, `borrower`110- Role-checking patterns: `onlyRole`, `hasRole`, `require(msg.sender == X)`, `assert_owner`, `#[access_control]`111- When role is ambiguous, flag as **"Restricted (review required)"** with the restriction pattern noted112113### 3. Contract-Only (Internal Integration Points)114Functions callable only by other contracts, not by EOAs. Indicators:115- Callbacks: `onERC721Received`, `uniswapV3SwapCallback`, `flashLoanCallback`116- Interface implementations with contract-caller checks117- Functions that revert if `tx.origin == msg.sender`118- Cross-contract hooks119120## Output Format121122Generate a markdown report with this structure:123124```markdown125# Entry Point Analysis: [Project Name]126127**Analyzed**: [timestamp]128**Scope**: [directories analyzed or "full codebase"]129**Languages**: [detected languages]130**Focus**: State-changing functions only (view/pure excluded)131132## Summary133134| Category | Count |135|----------|-------|136| Public (Unrestricted) | X |137| Role-Restricted | X |138| Restricted (Review Required) | X |139| Contract-Only | X |140| **Total** | **X** |141142---143144## Public Entry Points (Unrestricted)145146State-changing functions callable by anyone—prioritize for attack surface analysis.147148| Function | File | Notes |149|----------|------|-------|150| `functionName(params)` | `path/to/file.sol:L42` | Brief note if relevant |151152---153154## Role-Restricted Entry Points155156### Admin / Owner157| Function | File | Restriction |158|----------|------|-------------|159| `setFee(uint256)` | `Config.sol:L15` | `onlyOwner` |160161### Governance162| Function | File | Restriction |163|----------|------|-------------|164165### Guardian / Pauser166| Function | File | Restriction |167|----------|------|-------------|168169### Other Roles170| Function | File | Restriction | Role |171|----------|------|-------------|------|172173---174175## Restricted (Review Required)176177Functions with access control patterns that need manual verification.178179| Function | File | Pattern | Why Review |180|----------|------|---------|------------|181| `execute(bytes)` | `Executor.sol:L88` | `require(trusted[msg.sender])` | Dynamic trust list |182183---184185## Contract-Only (Internal Integration Points)186187Functions only callable by other contracts—useful for understanding trust boundaries.188189| Function | File | Expected Caller |190|----------|------|-----------------|191| `onFlashLoan(...)` | `Vault.sol:L200` | Flash loan provider |192193---194195## Files Analyzed196197- `path/to/file1.sol` (X state-changing entry points)198- `path/to/file2.sol` (X state-changing entry points)199```200201## Filtering202203When user specifies a directory filter:204- Only analyze files within that path205- Note the filter in the report header206- Example: "Analyze only `src/core/`" → scope = `src/core/`207208## Analysis Guidelines2092101. **Be thorough**: Don't skip files. Every state-changing externally callable function matters.2112. **Be conservative**: When uncertain about access level, flag for review rather than miscategorize.2123. **Skip read-only**: Exclude `view`, `pure`, and equivalent read-only functions.2134. **Note inheritance**: If a function's access control comes from a parent contract, note this.2145. **Track modifiers**: List all access-related modifiers/decorators applied to each function.2156. **Identify patterns**: Look for common patterns like:216 - Initializer functions (often unrestricted on first call)217 - Upgrade functions (high-privilege)218 - Emergency/pause functions (guardian-level)219 - Fee/parameter setters (admin-level)220 - Token transfers and approvals (often public)221222## Common Role Patterns by Protocol Type223224| Protocol Type | Common Roles |225|---------------|--------------|226| DEX | `owner`, `feeManager`, `pairCreator` |227| Lending | `admin`, `guardian`, `liquidator`, `oracle` |228| Governance | `proposer`, `executor`, `canceller`, `timelock` |229| NFT | `minter`, `admin`, `royaltyReceiver` |230| Bridge | `relayer`, `guardian`, `validator`, `operator` |231| Vault/Yield | `strategist`, `keeper`, `harvester`, `manager` |232233## Rationalizations to Reject234235When analyzing entry points, reject these shortcuts:236- "This function looks standard" → Still classify it; standard functions can have non-standard access control237- "The modifier name is clear" → Verify the modifier's actual implementation238- "This is obviously admin-only" → Trace the actual restriction; "obvious" assumptions miss subtle bypasses239- "I'll skip the callbacks" → Callbacks define trust boundaries; always include them240- "It doesn't modify much state" → Any state change can be exploited; include all non-view functions241242## Error Handling243244If a file cannot be parsed:2451. Note it in the report under "Analysis Warnings"2462. Continue with remaining files2473. Suggest manual review for unparsable files248249---250251**Source:** [`trailofbits/skills`](https://github.com/trailofbits/skills) → `plugins/entry-point-analyzer/skills/entry-point-analyzer/SKILL.md`