auditing-foundry-smart-contract-security
Pre-deployment security audit of Solidity smart contracts in a Foundry project.
Skill by mukul975
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mukul975-auditing-foundry-smart-contract-security
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, testing, devops, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/auditing-foundry-smart-contract-security
What's inside
- Skill name
auditing-foundry-smart-contract-security- Description
- Pre-deployment security audit of Solidity smart contracts in a Foundry project. Combines static analysis (Slither, Aderyn), symbolic execution (Mythril), and property-based testing (forge fuzz + invariant tests with handlers) to catch reentrancy, access-control, oracle/price manipulation, and arithmetic bugs BEFORE deploying to an EVM chain. Also enforces key hygiene (no plaintext private keys, encrypted cast keystore) and a secure deploy workflow. Use when writing, reviewing, testing, or deploying Solidity/Foundry contracts, building a dApp, or working with forge/cast/anvil, MetaMask, or Web3/DeFi code.
- License
- Apache-2.0
- Instructions
- 136 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (6)
- LICENSE
- SKILL.md
- api-reference.md · references/
- secure-deployment-and-keys.md · references/
- vulnerability-checklist.md · references/
- agent.py · scripts/
SKILL.md (first lines)
# Auditing Foundry Smart Contract Security ## Overview Deployed smart contracts are **immutable** and custody **real funds**, so a bug shipped to mainnet cannot be patched — it can only be exploited. Most catastrophic DeFi losses come from a small set of recurring classes: reentrancy, broken access control, oracle/price manipulation, and unchecked arithmetic or external calls. This skill runs a **defense-in-depth, pre-deployment audit** of a Foundry project, layering four independent techniques that each catch what the others miss: 1. **Static analysis** — `slither` (90+ detectors) and `aderyn` (Cyfrin, Rust) scan the AST/IR in seconds for known anti-patterns. 2. **Symbolic execution** — `mythril` (optional, slow) explores execution paths and SMT-solves for deep arithmetic/reentrancy bugs. 3. **Property-based testing** — `forge test` with **fuzzing** (`testFuzz_*`) and **invariant tests** (`invariant_*` + handler contracts with ghost variables) proves protocol-level properties hold across millions of random sequences. 4. **Manual review + key hygiene** — a structured checklist (see `references/vulnerability-checklist.md`) and a secrets/keystore audit so no private key ever lives in plaintext and deployment goes through an encrypted `cast` keystore (see `references/secure-deployment-and-keys.md`). The skill is **dev-side and pre-deployment** — it is run by the engineer building the contract, not by a SOC after an incident. Findings gate the deploy: any high/critical static finding, failing test, leaked key, or low coverage = **FAIL**. ## When to Use - Before deploying any Solidity contract to a testnet or mainnet EVM chain. - When writing or reviewing a Foundry project (`foundry.toml`, `src/`, `test/`, `script/`). - When a contract handles value: tokens (ERC-20/721/1155), vaults, staking, AMMs, bridges, governance. - When adding fuzz or invariant tests, or when coverage of value-moving functions is unknown. - When wiring deployment scripts — to verify keys are in an encrypted keystore, not `.env` plaintext. - When integrating a price oracle, external call, `delegatecall`, or upgradeable proxy. - When triaging a Slither/Aderyn report and needing to separate real bugs from false positives. ## Prerequisites - **Foundry** installed (`forge`, `cast`, `anvil`): `curl -L https://foundry.paradigm.xyz | bash && foundryup` - **Slither** + solc: `pip install slither-analyzer` and `solc-select install <ver> && solc-select use <ver>` - **Aderyn** (recommended): `cargo install aderyn` (or `npm i -g @cyfrin/aderyn`) - **Mythril** (optional, slow symbolic exec): `pip install mythril` - **gitleaks** (key-leak scan): see the companion `implementing-secret-scanning-with-gitleaks` skill - A Foundry project that **compiles** (`forge build` succeeds) — analyzers need build artifacts. - Solidity ^0.8.x is assumed (built-in overflow checks); pre-0.8 contracts need extra SafeMath review. > Install the Python tools in a virtualenv (recommended on externally-managed distros). Never run > analysis against untrusted contract source on a machine with funded wallets unlocked. ## Steps ### Step 1: Build and sanity-check the project ```bash forge build # analyzers require fresh artifacts forge fmt --check # style gate (optional) cat foundry.toml # note solc version, optimizer, remappings, evm_version ``` ### Step 2: Static analysis (fast, run every time) ```bash # Slither — full project (uses foundry.toml + remappings automatically) slither . --json slither-report.json # Aderyn — Cyfrin Rust analyzer, complementary detectors aderyn . -o aderyn-report.json ``` Or run the bundled orchestrator that runs both, deduplicates, and gates the result: ```bash python3 scripts/agent.py --project . --output audit-report.json ``` ### Step 3: Symbolic execution on critical contracts (optional, slow) ```bash # Only on the highest-value contract(s) — Mythril is path-explosive myth analyze src/Vault.sol --solc-json mythril.config.json --execution-timeout 300 -o json # or: python3 scripts/agent.py --project . --mythril src/Vault.sol ``` ### Step 4: Property-based testing — fuzz + invariants ```bash forge test -vvv # unit + fuzz tests forge coverage --report summary # coverage of value-moving code forge test --match-test invariant_ -vvv # invariant suite (handler-based) ``` Every value-moving contract should have **invariant tests with a handler** (bounded inputs, ghost variables, `targetContract(handler)`) — not just unit tests. See `references/api-reference.md` for the handler pattern, and write a `test_RevertWhen_*` (with `vm.expectRevert`) for each access-control guard. ### Step 5: Manual review against the checklist Walk `references/vulnerability-checklist.md` for every contract: reentrancy (checks-effects-interactions / `nonReentrant`), access control, oracle manipulation, `delegatecall`/proxy storage layout, unchecked return values, `tx.origin`, weak randomness, DoS, front-running/MEV, and ERC-specific pitfalls (approve race, fee-on-transfer, rebasing). ### Step 6: Key hygiene & secure deploy ```bash gitleaks detect --no-banner # no private keys / mnemonics / .env committed git ls-files | grep -E '\.env$|keystore' && echo "WARN: secrets tracked by git" # Import the deploy key ONCE into an encrypted keystore — never a plaintext PRIVATE_KEY env cast wallet import deployer --interactive # Deploy via the keystore account (testnet first), simulate before --broadcast forge script script/Deploy.s.sol --account deployer --rpc-url <testnet> --broadcast --verify ```
From mukul975/Anthropic-Cybersecurity-Skills, Apache-2.0.
More from mukul975/Anthropic-Cybersecurity-Skills
- 0.616score
conducting-spearphishing-simulation-campaign
mukul975
Run a targeted spearphishing simulation for initial access by developing OSINT-derived pretexts, building payloads (HTML smuggling, macro docs, ISO/LNK…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-social-engineering-penetration-test
mukul975
Design and execute a social engineering penetration test combining OSINT-driven target profiling with phishing, vishing, smishing, and physical pretexting…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-domain-persistence-with-dcsync
mukul975
Perform DCSync attacks by abusing MS-DRSR replication rights (DS-Replication-Get-Changes/-All) to impersonate a Domain Controller and extract KRBTGT, Domain…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-platform
mukul975
Design and deploy a Threat Intelligence Platform (TIP) by integrating open-source CTI tools (MISP, OpenCTI, TheHive, Cortex) into a unified system with feed…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-enrichment-in-splunk
mukul975
Build automated IOC enrichment pipelines in Splunk Enterprise Security by ingesting threat feeds into KV Store collections and correlating them against…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-vulnerability-aging-and-sla-tracking
mukul975
Implement a vulnerability aging dashboard and SLA tracking system that measures time-to-remediation against severity-based deadlines (e.g.
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
analyzing-cobaltstrike-malleable-c2-profiles
mukul975
Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
attacking-oauth-with-device-code-phishing
mukul975
Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-external-reconnaissance-with-osint
mukul975
Conduct external recon using OSINT techniques to map an organization's external attack surface without touching target systems, gathering DNS records…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-malware-incident-communication-template
mukul975
Build structured communication templates for malware incidents (ransomware, wiper, trojan, worm), covering internal stakeholder notifications, executive…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-gdpr-compliance-assessment
mukul975
Conduct comprehensive GDPR compliance assessments by evaluating data processing activities against EU Regulation 2016/679, including Article 30 records of…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
configuring-active-directory-tiered-model
mukul975
Implement Microsoft's Enhanced Security Admin Environment (ESAE) tiered administration model for Active Directory, covering Tier 0/1/2 separation, privileged…
SkillBFreshness: B★ 34.9KClaude Code +9
Signals
- Stars
- 34,941
- Forks
- 4,256
- Open issues
- 24
- Last commit (this folder)
- Jun 16, 2026 (4 months ago)
- Last release
- Jun 22, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mukul975
- 0.616score
building-threat-intelligence-platform
mukul975
Design and deploy a Threat Intelligence Platform (TIP) by integrating open-source CTI tools (MISP, OpenCTI, TheHive, Cortex) into a unified system with feed…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-vulnerability-aging-and-sla-tracking
mukul975
Implement a vulnerability aging dashboard and SLA tracking system that measures time-to-remediation against severity-based deadlines (e.g.
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-domain-persistence-with-dcsync
mukul975
Perform DCSync attacks by abusing MS-DRSR replication rights (DS-Replication-Get-Changes/-All) to impersonate a Domain Controller and extract KRBTGT, Domain…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-external-reconnaissance-with-osint
mukul975
Conduct external recon using OSINT techniques to map an organization's external attack surface without touching target systems, gathering DNS records…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-gdpr-compliance-assessment
mukul975
Conduct comprehensive GDPR compliance assessments by evaluating data processing activities against EU Regulation 2016/679, including Article 30 records of…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-enrichment-in-splunk
mukul975
Build automated IOC enrichment pipelines in Splunk Enterprise Security by ingesting threat feeds into KV Store collections and correlating them against…
SkillBFreshness: B★ 34.9KClaude Code +9
Cite this page
auditing-foundry-smart-contract-security skill. Agent Mart. https://agentmart.dev/skills/mukul975-auditing-foundry-smart-contract-security (last updated 2026-10-24)