@elizaos/skills 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/dist/formatter.d.ts +44 -0
- package/dist/formatter.d.ts.map +1 -0
- package/dist/formatter.js +182 -0
- package/dist/frontmatter.d.ts +39 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +105 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/loader.d.ts +33 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +362 -0
- package/dist/resolver.d.ts +18 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +90 -0
- package/dist/types.d.ts +201 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +57 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/bird/SKILL.md +224 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +203 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +51 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
- package/skills/security-ask-questions-if-underspecified/README.md +24 -0
- package/skills/security-ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
- package/skills/security-audit-context-building/README.md +58 -0
- package/skills/security-audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/commands/audit-context.md +21 -0
- package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
- package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
- package/skills/security-building-secure-contracts/README.md +241 -0
- package/skills/security-building-secure-contracts/SKILL.md +67 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
- package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
- package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
- package/skills/security-differential-review/README.md +109 -0
- package/skills/security-differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/commands/diff-review.md +21 -0
- package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
- package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
- package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
- package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
- package/skills/security-entry-point-analyzer/README.md +74 -0
- package/skills/security-entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
- package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
- package/skills/security-fix-review/README.md +118 -0
- package/skills/security-fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/commands/fix-review.md +24 -0
- package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
- package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
- package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
- package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills/security-insecure-defaults/README.md +45 -0
- package/skills/security-insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
- package/skills/security-modern-python/README.md +58 -0
- package/skills/security-modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/hooks/hooks.json +16 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
- package/skills/security-modern-python/hooks/test_helper.bash +75 -0
- package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills/security-property-based-testing/README.md +47 -0
- package/skills/security-property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
- package/skills/semgrep-rule-creator/README.md +43 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
- package/skills/sharp-edges/README.md +48 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +370 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -0
- package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
- package/skills/spec-to-code-compliance/README.md +67 -0
- package/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/static-analysis/README.md +59 -0
- package/skills/static-analysis/SKILL.md +91 -0
- package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
- package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
- package/skills/testing-handbook-skills/README.md +241 -0
- package/skills/testing-handbook-skills/SKILL.md +104 -0
- package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
- package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
- package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
- package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
- package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
- package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
- package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
- package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
- package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
- package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
- package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
- package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
- package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
- package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
- package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
- package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +135 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/variant-analysis/README.md +41 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/commands/variants.md +23 -0
- package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +54 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trailofbits:entry-points
|
|
3
|
+
description: Identifies state-changing entry points in smart contracts
|
|
4
|
+
argument-hint: "[directory-path]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- Bash
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Analyze Smart Contract Entry Points
|
|
13
|
+
|
|
14
|
+
**Arguments:** $ARGUMENTS
|
|
15
|
+
|
|
16
|
+
Parse the directory path from arguments. If empty, use current directory.
|
|
17
|
+
|
|
18
|
+
Invoke the `entry-point-analyzer` skill with the directory path for the full workflow.
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: entry-point-analyzer
|
|
3
|
+
description: 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
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Grep
|
|
7
|
+
- Glob
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Entry Point Analyzer
|
|
12
|
+
|
|
13
|
+
Systematically identify all **state-changing** entry points in a smart contract codebase to guide security audits.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Use this skill when:
|
|
18
|
+
- Starting a smart contract security audit to map the attack surface
|
|
19
|
+
- Asked to find entry points, external functions, or audit flows
|
|
20
|
+
- Analyzing access control patterns across a codebase
|
|
21
|
+
- Identifying privileged operations and role-restricted functions
|
|
22
|
+
- Building an understanding of which functions can modify contract state
|
|
23
|
+
|
|
24
|
+
## When NOT to Use
|
|
25
|
+
|
|
26
|
+
Do NOT use this skill for:
|
|
27
|
+
- Vulnerability detection (use audit-context-building or domain-specific-audits)
|
|
28
|
+
- Writing exploit POCs (use solidity-poc-builder)
|
|
29
|
+
- Code quality or gas optimization analysis
|
|
30
|
+
- Non-smart-contract codebases
|
|
31
|
+
- Analyzing read-only functions (this skill excludes them)
|
|
32
|
+
|
|
33
|
+
## Scope: State-Changing Functions Only
|
|
34
|
+
|
|
35
|
+
This skill focuses exclusively on functions that can modify state. **Excluded:**
|
|
36
|
+
|
|
37
|
+
| Language | Excluded Patterns |
|
|
38
|
+
|----------|-------------------|
|
|
39
|
+
| Solidity | `view`, `pure` functions |
|
|
40
|
+
| Vyper | `@view`, `@pure` functions |
|
|
41
|
+
| Solana | Functions without `mut` account references |
|
|
42
|
+
| Move | Non-entry `public fun` (module-callable only) |
|
|
43
|
+
| TON | `get` methods (FunC), read-only receivers (Tact) |
|
|
44
|
+
| CosmWasm | `query` entry point and its handlers |
|
|
45
|
+
|
|
46
|
+
**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.
|
|
47
|
+
|
|
48
|
+
## Workflow
|
|
49
|
+
|
|
50
|
+
1. **Detect Language** - Identify contract language(s) from file extensions and syntax
|
|
51
|
+
2. **Use Tooling (if available)** - For Solidity, check if Slither is available and use it
|
|
52
|
+
3. **Locate Contracts** - Find all contract/module files (apply directory filter if specified)
|
|
53
|
+
4. **Extract Entry Points** - Parse each file for externally callable, state-changing functions
|
|
54
|
+
5. **Classify Access** - Categorize each function by access level
|
|
55
|
+
6. **Generate Report** - Output structured markdown report
|
|
56
|
+
|
|
57
|
+
## Slither Integration (Solidity)
|
|
58
|
+
|
|
59
|
+
For Solidity codebases, Slither can automatically extract entry points. Before manual analysis:
|
|
60
|
+
|
|
61
|
+
### 1. Check if Slither is Available
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
which slither
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2. If Slither is Detected, Run Entry Points Printer
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
slither . --print entry-points
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This outputs a table of all state-changing entry points with:
|
|
74
|
+
- Contract name
|
|
75
|
+
- Function name
|
|
76
|
+
- Visibility
|
|
77
|
+
- Modifiers applied
|
|
78
|
+
|
|
79
|
+
### 3. Use Slither Output as Foundation
|
|
80
|
+
|
|
81
|
+
- Parse the Slither output table to populate your analysis
|
|
82
|
+
- Cross-reference with manual inspection for access control classification
|
|
83
|
+
- Slither may miss some patterns (callbacks, dynamic access control)—supplement with manual review
|
|
84
|
+
- If Slither fails (compilation errors, unsupported features), fall back to manual analysis
|
|
85
|
+
|
|
86
|
+
### 4. When Slither is NOT Available
|
|
87
|
+
|
|
88
|
+
If `which slither` returns nothing, proceed with manual analysis using the language-specific reference files.
|
|
89
|
+
|
|
90
|
+
## Language Detection
|
|
91
|
+
|
|
92
|
+
| Extension | Language | Reference |
|
|
93
|
+
|-----------|----------|-----------|
|
|
94
|
+
| `.sol` | Solidity | [{baseDir}/references/solidity.md]({baseDir}/references/solidity.md) |
|
|
95
|
+
| `.vy` | Vyper | [{baseDir}/references/vyper.md]({baseDir}/references/vyper.md) |
|
|
96
|
+
| `.rs` + `Cargo.toml` with `solana-program` | Solana (Rust) | [{baseDir}/references/solana.md]({baseDir}/references/solana.md) |
|
|
97
|
+
| `.move` + `Move.toml` with `edition` | [{baseDir}/references/move-sui.md]({baseDir}/references/move-sui.md) |
|
|
98
|
+
| `.move` + `Move.toml` with `Aptos` | [{baseDir}/references/move-aptos.md]({baseDir}/references/move-aptos.md) |
|
|
99
|
+
| `.fc`, `.func`, `.tact` | TON (FunC/Tact) | [{baseDir}/references/ton.md]({baseDir}/references/ton.md) |
|
|
100
|
+
| `.rs` + `Cargo.toml` with `cosmwasm-std` | CosmWasm | [{baseDir}/references/cosmwasm.md]({baseDir}/references/cosmwasm.md) |
|
|
101
|
+
|
|
102
|
+
Load the appropriate reference file(s) based on detected language before analysis.
|
|
103
|
+
|
|
104
|
+
## Access Classification
|
|
105
|
+
|
|
106
|
+
Classify each state-changing entry point into one of these categories:
|
|
107
|
+
|
|
108
|
+
### 1. Public (Unrestricted)
|
|
109
|
+
Functions callable by anyone without restrictions.
|
|
110
|
+
|
|
111
|
+
### 2. Role-Restricted
|
|
112
|
+
Functions limited to specific roles. Common patterns to detect:
|
|
113
|
+
- Explicit role names: `admin`, `owner`, `governance`, `guardian`, `operator`, `manager`, `minter`, `pauser`, `keeper`, `relayer`, `lender`, `borrower`
|
|
114
|
+
- Role-checking patterns: `onlyRole`, `hasRole`, `require(msg.sender == X)`, `assert_owner`, `#[access_control]`
|
|
115
|
+
- When role is ambiguous, flag as **"Restricted (review required)"** with the restriction pattern noted
|
|
116
|
+
|
|
117
|
+
### 3. Contract-Only (Internal Integration Points)
|
|
118
|
+
Functions callable only by other contracts, not by EOAs. Indicators:
|
|
119
|
+
- Callbacks: `onERC721Received`, `uniswapV3SwapCallback`, `flashLoanCallback`
|
|
120
|
+
- Interface implementations with contract-caller checks
|
|
121
|
+
- Functions that revert if `tx.origin == msg.sender`
|
|
122
|
+
- Cross-contract hooks
|
|
123
|
+
|
|
124
|
+
## Output Format
|
|
125
|
+
|
|
126
|
+
Generate a markdown report with this structure:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
# Entry Point Analysis: [Project Name]
|
|
130
|
+
|
|
131
|
+
**Analyzed**: [timestamp]
|
|
132
|
+
**Scope**: [directories analyzed or "full codebase"]
|
|
133
|
+
**Languages**: [detected languages]
|
|
134
|
+
**Focus**: State-changing functions only (view/pure excluded)
|
|
135
|
+
|
|
136
|
+
## Summary
|
|
137
|
+
|
|
138
|
+
| Category | Count |
|
|
139
|
+
|----------|-------|
|
|
140
|
+
| Public (Unrestricted) | X |
|
|
141
|
+
| Role-Restricted | X |
|
|
142
|
+
| Restricted (Review Required) | X |
|
|
143
|
+
| Contract-Only | X |
|
|
144
|
+
| **Total** | **X** |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Public Entry Points (Unrestricted)
|
|
149
|
+
|
|
150
|
+
State-changing functions callable by anyone—prioritize for attack surface analysis.
|
|
151
|
+
|
|
152
|
+
| Function | File | Notes |
|
|
153
|
+
|----------|------|-------|
|
|
154
|
+
| `functionName(params)` | `path/to/file.sol:L42` | Brief note if relevant |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Role-Restricted Entry Points
|
|
159
|
+
|
|
160
|
+
### Admin / Owner
|
|
161
|
+
| Function | File | Restriction |
|
|
162
|
+
|----------|------|-------------|
|
|
163
|
+
| `setFee(uint256)` | `Config.sol:L15` | `onlyOwner` |
|
|
164
|
+
|
|
165
|
+
### Governance
|
|
166
|
+
| Function | File | Restriction |
|
|
167
|
+
|----------|------|-------------|
|
|
168
|
+
|
|
169
|
+
### Guardian / Pauser
|
|
170
|
+
| Function | File | Restriction |
|
|
171
|
+
|----------|------|-------------|
|
|
172
|
+
|
|
173
|
+
### Other Roles
|
|
174
|
+
| Function | File | Restriction | Role |
|
|
175
|
+
|----------|------|-------------|------|
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Restricted (Review Required)
|
|
180
|
+
|
|
181
|
+
Functions with access control patterns that need manual verification.
|
|
182
|
+
|
|
183
|
+
| Function | File | Pattern | Why Review |
|
|
184
|
+
|----------|------|---------|------------|
|
|
185
|
+
| `execute(bytes)` | `Executor.sol:L88` | `require(trusted[msg.sender])` | Dynamic trust list |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Contract-Only (Internal Integration Points)
|
|
190
|
+
|
|
191
|
+
Functions only callable by other contracts—useful for understanding trust boundaries.
|
|
192
|
+
|
|
193
|
+
| Function | File | Expected Caller |
|
|
194
|
+
|----------|------|-----------------|
|
|
195
|
+
| `onFlashLoan(...)` | `Vault.sol:L200` | Flash loan provider |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Files Analyzed
|
|
200
|
+
|
|
201
|
+
- `path/to/file1.sol` (X state-changing entry points)
|
|
202
|
+
- `path/to/file2.sol` (X state-changing entry points)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Filtering
|
|
206
|
+
|
|
207
|
+
When user specifies a directory filter:
|
|
208
|
+
- Only analyze files within that path
|
|
209
|
+
- Note the filter in the report header
|
|
210
|
+
- Example: "Analyze only `src/core/`" → scope = `src/core/`
|
|
211
|
+
|
|
212
|
+
## Analysis Guidelines
|
|
213
|
+
|
|
214
|
+
1. **Be thorough**: Don't skip files. Every state-changing externally callable function matters.
|
|
215
|
+
2. **Be conservative**: When uncertain about access level, flag for review rather than miscategorize.
|
|
216
|
+
3. **Skip read-only**: Exclude `view`, `pure`, and equivalent read-only functions.
|
|
217
|
+
4. **Note inheritance**: If a function's access control comes from a parent contract, note this.
|
|
218
|
+
5. **Track modifiers**: List all access-related modifiers/decorators applied to each function.
|
|
219
|
+
6. **Identify patterns**: Look for common patterns like:
|
|
220
|
+
- Initializer functions (often unrestricted on first call)
|
|
221
|
+
- Upgrade functions (high-privilege)
|
|
222
|
+
- Emergency/pause functions (guardian-level)
|
|
223
|
+
- Fee/parameter setters (admin-level)
|
|
224
|
+
- Token transfers and approvals (often public)
|
|
225
|
+
|
|
226
|
+
## Common Role Patterns by Protocol Type
|
|
227
|
+
|
|
228
|
+
| Protocol Type | Common Roles |
|
|
229
|
+
|---------------|--------------|
|
|
230
|
+
| DEX | `owner`, `feeManager`, `pairCreator` |
|
|
231
|
+
| Lending | `admin`, `guardian`, `liquidator`, `oracle` |
|
|
232
|
+
| Governance | `proposer`, `executor`, `canceller`, `timelock` |
|
|
233
|
+
| NFT | `minter`, `admin`, `royaltyReceiver` |
|
|
234
|
+
| Bridge | `relayer`, `guardian`, `validator`, `operator` |
|
|
235
|
+
| Vault/Yield | `strategist`, `keeper`, `harvester`, `manager` |
|
|
236
|
+
|
|
237
|
+
## Rationalizations to Reject
|
|
238
|
+
|
|
239
|
+
When analyzing entry points, reject these shortcuts:
|
|
240
|
+
- "This function looks standard" → Still classify it; standard functions can have non-standard access control
|
|
241
|
+
- "The modifier name is clear" → Verify the modifier's actual implementation
|
|
242
|
+
- "This is obviously admin-only" → Trace the actual restriction; "obvious" assumptions miss subtle bypasses
|
|
243
|
+
- "I'll skip the callbacks" → Callbacks define trust boundaries; always include them
|
|
244
|
+
- "It doesn't modify much state" → Any state change can be exploited; include all non-view functions
|
|
245
|
+
|
|
246
|
+
## Error Handling
|
|
247
|
+
|
|
248
|
+
If a file cannot be parsed:
|
|
249
|
+
1. Note it in the report under "Analysis Warnings"
|
|
250
|
+
2. Continue with remaining files
|
|
251
|
+
3. Suggest manual review for unparsable files
|
package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# CosmWasm Entry Point Detection
|
|
2
|
+
|
|
3
|
+
## Entry Point Identification (State-Changing Only)
|
|
4
|
+
|
|
5
|
+
### Include: State-Changing Entry Points
|
|
6
|
+
```rust
|
|
7
|
+
// Instantiate - called once on deployment
|
|
8
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
9
|
+
pub fn instantiate(
|
|
10
|
+
deps: DepsMut,
|
|
11
|
+
env: Env,
|
|
12
|
+
info: MessageInfo,
|
|
13
|
+
msg: InstantiateMsg,
|
|
14
|
+
) -> Result<Response, ContractError> { }
|
|
15
|
+
|
|
16
|
+
// Execute - main entry point for state changes
|
|
17
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
18
|
+
pub fn execute(
|
|
19
|
+
deps: DepsMut,
|
|
20
|
+
env: Env,
|
|
21
|
+
info: MessageInfo,
|
|
22
|
+
msg: ExecuteMsg,
|
|
23
|
+
) -> Result<Response, ContractError> { }
|
|
24
|
+
|
|
25
|
+
// Query - read-only entry point
|
|
26
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
27
|
+
pub fn query(
|
|
28
|
+
deps: Deps,
|
|
29
|
+
env: Env,
|
|
30
|
+
msg: QueryMsg,
|
|
31
|
+
) -> StdResult<Binary> { }
|
|
32
|
+
|
|
33
|
+
// Migrate - called on contract migration
|
|
34
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
35
|
+
pub fn migrate(
|
|
36
|
+
deps: DepsMut,
|
|
37
|
+
env: Env,
|
|
38
|
+
msg: MigrateMsg,
|
|
39
|
+
) -> Result<Response, ContractError> { }
|
|
40
|
+
|
|
41
|
+
// Reply - handles submessage responses
|
|
42
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
43
|
+
pub fn reply(
|
|
44
|
+
deps: DepsMut,
|
|
45
|
+
env: Env,
|
|
46
|
+
msg: Reply,
|
|
47
|
+
) -> Result<Response, ContractError> { }
|
|
48
|
+
|
|
49
|
+
// Sudo - privileged operations (governance)
|
|
50
|
+
#[cfg_attr(not(feature = "library"), entry_point)]
|
|
51
|
+
pub fn sudo(
|
|
52
|
+
deps: DepsMut,
|
|
53
|
+
env: Env,
|
|
54
|
+
msg: SudoMsg,
|
|
55
|
+
) -> Result<Response, ContractError> { }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Entry Point Types
|
|
59
|
+
| Entry Point | Include? | Classification | Notes |
|
|
60
|
+
|-------------|----------|----------------|-------|
|
|
61
|
+
| `instantiate` | **Yes** | One-time setup | Sets initial state |
|
|
62
|
+
| `execute` | **Yes** | Main dispatcher | Contains multiple operations |
|
|
63
|
+
| `query` | No | Read-only | EXCLUDE - no state changes |
|
|
64
|
+
| `migrate` | **Yes** | Admin/Governance | Requires migration permission |
|
|
65
|
+
| `reply` | **Yes** | Contract-Only | Submessage callback |
|
|
66
|
+
| `sudo` | **Yes** | Governance | Chain-level privileged |
|
|
67
|
+
|
|
68
|
+
### ExecuteMsg Variants (Primary Focus)
|
|
69
|
+
```rust
|
|
70
|
+
#[cw_serde]
|
|
71
|
+
pub enum ExecuteMsg {
|
|
72
|
+
Transfer { recipient: String, amount: Uint128 }, // Usually public
|
|
73
|
+
UpdateConfig { admin: Option<String> }, // Admin only
|
|
74
|
+
Pause {}, // Guardian
|
|
75
|
+
Withdraw { amount: Uint128 }, // Public or restricted
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Access Control Patterns
|
|
80
|
+
|
|
81
|
+
### Cw-Ownable Pattern
|
|
82
|
+
```rust
|
|
83
|
+
use cw_ownable::{assert_owner, initialize_owner};
|
|
84
|
+
|
|
85
|
+
pub fn execute_admin_action(deps: DepsMut, info: MessageInfo) -> Result<...> {
|
|
86
|
+
assert_owner(deps.storage, &info.sender)?;
|
|
87
|
+
// ...
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Manual Owner Check
|
|
92
|
+
```rust
|
|
93
|
+
pub fn execute_update_config(deps: DepsMut, info: MessageInfo) -> Result<...> {
|
|
94
|
+
let config = CONFIG.load(deps.storage)?;
|
|
95
|
+
if info.sender != config.owner {
|
|
96
|
+
return Err(ContractError::Unauthorized {});
|
|
97
|
+
}
|
|
98
|
+
// ...
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Role-Based Access
|
|
103
|
+
```rust
|
|
104
|
+
// Common patterns
|
|
105
|
+
if info.sender != state.admin { return Err(Unauthorized); }
|
|
106
|
+
if info.sender != state.governance { return Err(Unauthorized); }
|
|
107
|
+
if !state.operators.contains(&info.sender) { return Err(Unauthorized); }
|
|
108
|
+
|
|
109
|
+
// Using cw-controllers
|
|
110
|
+
use cw_controllers::Admin;
|
|
111
|
+
ADMIN.assert_admin(deps.as_ref(), &info.sender)?;
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Access Control Classification
|
|
115
|
+
| Pattern | Classification |
|
|
116
|
+
|---------|----------------|
|
|
117
|
+
| `assert_owner(storage, &sender)` | Owner |
|
|
118
|
+
| `ADMIN.assert_admin(deps, &sender)` | Admin |
|
|
119
|
+
| `info.sender != config.owner` | Owner |
|
|
120
|
+
| `info.sender != config.admin` | Admin |
|
|
121
|
+
| `info.sender != config.governance` | Governance |
|
|
122
|
+
| `!operators.contains(&sender)` | Operator |
|
|
123
|
+
| `!guardians.contains(&sender)` | Guardian |
|
|
124
|
+
| No sender check | Public (Unrestricted) |
|
|
125
|
+
|
|
126
|
+
## Contract-Only Detection
|
|
127
|
+
|
|
128
|
+
### Reply Handler
|
|
129
|
+
```rust
|
|
130
|
+
#[entry_point]
|
|
131
|
+
pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractError> {
|
|
132
|
+
match msg.id {
|
|
133
|
+
INSTANTIATE_REPLY_ID => handle_instantiate_reply(deps, msg),
|
|
134
|
+
_ => Err(ContractError::UnknownReplyId { id: msg.id }),
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Callback Messages
|
|
140
|
+
```rust
|
|
141
|
+
// Messages expected from other contracts
|
|
142
|
+
ExecuteMsg::Callback { ... } => {
|
|
143
|
+
// Should verify sender is expected contract
|
|
144
|
+
if info.sender != expected_contract {
|
|
145
|
+
return Err(ContractError::Unauthorized {});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Extraction Strategy
|
|
151
|
+
|
|
152
|
+
1. **Find Message Enums**:
|
|
153
|
+
- `ExecuteMsg` - main operations (INCLUDE)
|
|
154
|
+
- `QueryMsg` - read operations (EXCLUDE)
|
|
155
|
+
- `SudoMsg` - governance operations (INCLUDE)
|
|
156
|
+
|
|
157
|
+
2. **For Each ExecuteMsg Variant**:
|
|
158
|
+
- Find handler function (usually `execute_<variant_name>`)
|
|
159
|
+
- Check for access control at start of function
|
|
160
|
+
- Classify by access pattern
|
|
161
|
+
|
|
162
|
+
3. **Map Entry Points**:
|
|
163
|
+
- `execute` dispatcher → enumerate variants (state-changing)
|
|
164
|
+
- `query` → **SKIP** (read-only, no state changes)
|
|
165
|
+
- `sudo` → all variants are governance-level
|
|
166
|
+
- `reply` → contract-only callbacks
|
|
167
|
+
|
|
168
|
+
## CosmWasm-Specific Considerations
|
|
169
|
+
|
|
170
|
+
1. **Message Info**: `info.sender` is the caller address
|
|
171
|
+
2. **Query Has No Sender**: Queries are stateless, no access control
|
|
172
|
+
3. **Sudo Is Privileged**: Only callable by chain governance
|
|
173
|
+
4. **Submessages**: `reply` handles responses from submessages
|
|
174
|
+
5. **IBC**: IBC entry points for cross-chain messages
|
|
175
|
+
|
|
176
|
+
## Common Gotchas
|
|
177
|
+
|
|
178
|
+
1. **Instantiate Race**: First caller sets owner if not careful
|
|
179
|
+
2. **Migration Admin**: Separate from contract admin
|
|
180
|
+
3. **Cw20 Callbacks**: `Cw20ReceiveMsg` is a callback pattern
|
|
181
|
+
4. **IBC Callbacks**: `ibc_packet_receive` etc. are entry points
|
|
182
|
+
5. **Admin vs Owner**: May be different addresses
|
package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Move Entry Point Detection (Aptos)
|
|
2
|
+
|
|
3
|
+
## Entry Point Identification (State-Changing Only)
|
|
4
|
+
|
|
5
|
+
In Move, `public` functions can be invoked from transaction scripts (Aptos) and typically modify state. In addition, all `entry` functions are entrypoints. Package-protected (`public package`) and friend (`friend` or `public friend`) functions should be excluded.
|
|
6
|
+
|
|
7
|
+
### Aptos Move
|
|
8
|
+
```move
|
|
9
|
+
// Public entry functions are entry points
|
|
10
|
+
public entry fun transfer(from: &signer, to: address, amount: u64) { }
|
|
11
|
+
|
|
12
|
+
// Public functions callable by other modules
|
|
13
|
+
public fun helper(): u64 { }
|
|
14
|
+
|
|
15
|
+
// Entry-only functions (can't be called by other modules)
|
|
16
|
+
entry fun private_entry(account: &signer) { }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Visibility Rules
|
|
20
|
+
| Visibility | Include? | Notes |
|
|
21
|
+
|------------|----------|-------|
|
|
22
|
+
| `public entry fun` | **Yes** | Transaction entry point (state-changing) |
|
|
23
|
+
| `entry fun` | **Yes** | Transaction-only entry point |
|
|
24
|
+
| `public fun` | No | Module-callable only, not direct entry |
|
|
25
|
+
| `fun` (private) | No | Not externally callable |
|
|
26
|
+
| `public(friend) fun` | No | Friend modules only |
|
|
27
|
+
|
|
28
|
+
## Access Control Patterns
|
|
29
|
+
|
|
30
|
+
### Signer-Based Control (Aptos)
|
|
31
|
+
```move
|
|
32
|
+
// Admin check via signer
|
|
33
|
+
public entry fun admin_action(admin: &signer) {
|
|
34
|
+
assert!(signer::address_of(admin) == @admin_address, E_NOT_ADMIN);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Owner check via resource
|
|
38
|
+
public entry fun owner_action(owner: &signer) acquires Config {
|
|
39
|
+
let config = borrow_global<Config>(@module_addr);
|
|
40
|
+
assert!(signer::address_of(owner) == config.owner, E_NOT_OWNER);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Capability Pattern (Aptos)
|
|
45
|
+
```move
|
|
46
|
+
// Capability resource
|
|
47
|
+
struct AdminCap has key, store {}
|
|
48
|
+
|
|
49
|
+
// Requires capability
|
|
50
|
+
public entry fun admin_action(admin: &signer) acquires AdminCap {
|
|
51
|
+
assert!(exists<AdminCap>(signer::address_of(admin)), E_NO_CAP);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Access Control Classification
|
|
56
|
+
| Pattern | Classification |
|
|
57
|
+
|---------|----------------|
|
|
58
|
+
| `signer::address_of(s) == @admin` | Admin |
|
|
59
|
+
| `signer::address_of(s) == config.owner` | Owner |
|
|
60
|
+
| `exists<AdminCap>(addr)` | Admin (capability) |
|
|
61
|
+
| `exists<GovernanceCap>(addr)` | Governance |
|
|
62
|
+
| `exists<GuardianCap>(addr)` | Guardian |
|
|
63
|
+
| `&signer` with no checks | Review Required |
|
|
64
|
+
|
|
65
|
+
## Contract-Only Detection
|
|
66
|
+
|
|
67
|
+
### Friend Functions
|
|
68
|
+
```move
|
|
69
|
+
// Only callable by friend modules
|
|
70
|
+
public(friend) fun internal_callback() { }
|
|
71
|
+
|
|
72
|
+
// Friend declaration
|
|
73
|
+
friend other_module;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Module-to-Module Patterns
|
|
77
|
+
```move
|
|
78
|
+
// Functions designed for other modules
|
|
79
|
+
public fun on_transfer_hook(amount: u64): bool {
|
|
80
|
+
// Called by token module
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Extraction Strategy
|
|
85
|
+
|
|
86
|
+
### Aptos
|
|
87
|
+
1. Parse all `.move` files
|
|
88
|
+
2. Find `module` declarations
|
|
89
|
+
3. Extract functions with `public entry` or `entry` visibility
|
|
90
|
+
4. Check function body for:
|
|
91
|
+
- `signer::address_of` comparisons → Role-based
|
|
92
|
+
- `exists<*Cap>` checks → Capability-based
|
|
93
|
+
- No access checks → Public (Unrestricted)
|
|
94
|
+
|
|
95
|
+
## Move-Specific Considerations
|
|
96
|
+
|
|
97
|
+
1. **Resource Model**: Access control often through resource ownership
|
|
98
|
+
2. **Capabilities**: `Cap` suffix typically indicates capability pattern
|
|
99
|
+
3. **Acquires**: `acquires Resource` shows what global resources are accessed
|
|
100
|
+
4. **Generic Types**: Type parameters may carry capability constraints
|
|
101
|
+
5. **Friend Visibility**: `public(friend)` limits callers to declared friends
|
|
102
|
+
|
|
103
|
+
## Common Gotchas
|
|
104
|
+
|
|
105
|
+
1. **Init Functions**: `init` or `initialize` often create initial capabilities
|
|
106
|
+
2. **Module Upgrades**: Check upgrade capability ownership
|
|
107
|
+
3. **Phantom Types**: Type parameters with `phantom` don't affect runtime
|
package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Move Entry Point Detection (Sui)
|
|
2
|
+
|
|
3
|
+
## Entry Point Identification (State-Changing Only)
|
|
4
|
+
|
|
5
|
+
In Move, `public` functions can be invoked from programmable transaction blocks (Sui) or transaction scripts (Aptos) and typically modify state. In addition, private `entry` functions are entrypoints. Package-protected (`public(package) fun`) and private (`fun`) functions should be excluded.
|
|
6
|
+
|
|
7
|
+
```move
|
|
8
|
+
// Public functions
|
|
9
|
+
public fun compute(obj: &mut Object): u64 { }
|
|
10
|
+
|
|
11
|
+
// Entry functions in Sui
|
|
12
|
+
public entry fun transfer(ctx: &mut TxContext) { }
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Visibility Rules
|
|
16
|
+
| Visibility | Include? | Notes |
|
|
17
|
+
|------------|----------|-------|
|
|
18
|
+
| `public entry fun` | **Yes** | Callable from transactions and modules |
|
|
19
|
+
| `public fun` | **Yes** | Callable from transactions and modules |
|
|
20
|
+
| `entry fun` | **Yes** | Callable from transactions, but not other modules |
|
|
21
|
+
| `fun` (private) | No | Not externally callable |
|
|
22
|
+
| `public(package) fun` | No | Only callable by other modules in the same package |
|
|
23
|
+
|
|
24
|
+
## Access Control Patterns
|
|
25
|
+
|
|
26
|
+
```move
|
|
27
|
+
// Object types have the key ability
|
|
28
|
+
public struct MyObject has key { id: ID, ... }
|
|
29
|
+
|
|
30
|
+
// Capability objects typically have names that end with "Cap"
|
|
31
|
+
public struct AdminCap has key { id: ID, ... }
|
|
32
|
+
|
|
33
|
+
// Shared objects are created via `public_share
|
|
34
|
+
public struct Pool has key { id: ID, ... }
|
|
35
|
+
|
|
36
|
+
// Object ownership provides access control
|
|
37
|
+
public fun use_owned_object(obj: &mut MyObject) {
|
|
38
|
+
// Only owner of obj can call this
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Shared object - anyone can access
|
|
42
|
+
public fun use_shared(pool: &mut Pool) { }
|
|
43
|
+
|
|
44
|
+
// Shared Pool object gated by capability - only owner of AdminCap can call
|
|
45
|
+
public fun capability_gate(_cap: &AdminCap, pool: &mut Pool) {}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Access Control Classification
|
|
49
|
+
| Pattern | Classification |
|
|
50
|
+
|---------|----------------|
|
|
51
|
+
| Owned object parameter | Owner of object |
|
|
52
|
+
| Shared object | Public (Unrestricted) |
|
|
53
|
+
|
|
54
|
+
## Contract-Only Detection
|
|
55
|
+
|
|
56
|
+
### Package-protected Functions
|
|
57
|
+
```move
|
|
58
|
+
// Only callable by other modules in the same Move package
|
|
59
|
+
public(protected) fun internal_fun() { }
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Extraction Strategy
|
|
63
|
+
|
|
64
|
+
1. Parse all `.move` files
|
|
65
|
+
2. Find `module` declarations
|
|
66
|
+
3. Extract `public`, `public entry`, and `entry` functions
|
|
67
|
+
4. Extract object type declarations (`struct`'s that have the `key` ability)
|
|
68
|
+
5. Determine whether each object type is **owned** (passed as parameter to `transfer` or `public_transfer` functions) or **shared** (passed as parameter to `share` or `public_share` functions)
|
|
69
|
+
6. Analyze parameters:
|
|
70
|
+
- Owned object type with "XCap" in name -> X role (e.g., AdminCap = Admin role, GuardianCap = Guardian role)
|
|
71
|
+
- Owned object type without "Cap" in name -> Owner role
|
|
72
|
+
- Shared object type -> Public
|
|
73
|
+
|
|
74
|
+
## Move-Specific Considerations
|
|
75
|
+
|
|
76
|
+
1. **Object Model**: Access control typically through object ownership (rather than runtime assertions)
|
|
77
|
+
2. **Capabilities**: `Cap` suffix typically indicates capability pattern
|
|
78
|
+
4. **Generic Types**: Type parameters may carry capability constraints
|
|
79
|
+
5. **Package Visibility**: `public(pacakge)` limits callers to modules in the same package
|
|
80
|
+
|
|
81
|
+
## Common Gotchas
|
|
82
|
+
|
|
83
|
+
1. **Module Initializers**: `init` functions often create singletone shared objects and initial capabilities
|
|
84
|
+
2. **Object Wrapping**: Wrapped objects transfer ownership
|
|
85
|
+
3. **Shared vs Owned**: Shared objects can be accessed by anyone, owned objects only by a transaction sent by the owner
|
|
86
|
+
4. **Package Upgrades**: Upgrades can introduce new types and functions and change old ones in type-compatible ways
|
|
87
|
+
5. **Phantom Types**: Type parameters with `phantom` don't affect runtime
|