一键导入
openaudit
// Run a smart contract source code through several agent skill-based auditing pipelines
// Run a smart contract source code through several agent skill-based auditing pipelines
| name | openaudit |
| description | Run a smart contract source code through several agent skill-based auditing pipelines |
Run a smart contract source code through several agent skill-based auditing pipelines. By using multiple tools and techniques, we can get a more comprehensive understanding of the security and quality of the smart contract.
This skill lives in the openaudit repository. Key paths:
skills/openaudit/ (this directory)deps/ (11 git submodules — already checked out)pyproject.toml → install with uv syncpackage.json → install with npm installcontracts/ERC20.sol (for testing the toolchain)See the repo's README.md for full installation instructions and prerequisites.
Before starting, gather the following information from the user:
You are going to require environment variables like JSON_RPC_ETHEREUM and ETHERSCAN_API_KEY to access blockchain data and APIs. Use Unix source command to read these from env.sh file:
source env.sh
We run multiple skill-based auditing pipelines on the same source code and generate a report for each of them, and save the resulting reports to a created project working directory.
Run scripts/check-prerequisites.sh to check what software we have installed the skills may ask.
Show the output of installed software in the conversation in a table format.
Create a project out/{protocol_slug}.
aave-0x123456.Assume we are auditing Solidity unless otherwise stated.
Get the list of different audit skill repos from smart-contract-auditing-skills.md.
If the skill needs you to make decisions how to use it, like need to choose from multiple skills across different programming languages, write a .claude/projects/{protocol_slug}/{skill_repo_name}/plan.md, and then follow this plan.
For whatever software we installed or are going to use, save .claude/projects/{protocol_slug}/{skill_repo_name}/requirements.md with the software name, version and how did we install it.
Before performing this step, use ask user tool to confirm which pipelines we are going to run.
out/{protocol_slug}/src folderout/{protocol_slug}/abi folderIf the contract uses a proxy pattern (EIP-1967, etc.), download the implementation contract's full source tree, not the proxy's minimal code.
If the contract delegates to extension contracts (via fallback, delegatecall, or an extensions registry), identify all extension addresses on-chain and download their source code too:
out/{protocol_slug}/src-extensions/{extension_name}/All downloaded contracts (main implementation + extensions + adapters + governance) are in scope for the audit pipelines. Libraries imported by any of these contracts are also in scope.
Read how-to-get-source-code.md for more details on how to get the source code files from different blockchains and explorers.
Use the blockchain explorer UI and ABI information to extract critical addresses.
Create one table output with columns
For privileged addresses, with ownership rights and such, create second table output with columns
Save this in out/{protocol_slug}/reports/addresses-{protocol_slug}.md
For ABI extraction use web3.py library or similar to parse the ABI and extract function signatures, events, and other relevant information.
Use Web3.py for reading onchain data. We are using web3-eth-defu environment variables for JSON-RPC configuration, supporting multiple RPCs per chain.
The skill repos are in deps/. There are two categories of pipelines:
Category A — Static analysis tools (Slither, Aderyn, Semgrep): These run external binaries on the source code and produce machine-readable output. Run them with:
uv run slither {src_dir} --json {output_dir}/slither-output.jsonaderyn {src_dir} --output {output_dir}/aderyn-report.mduv run semgrep --metrics=off --config "r/solidity" --json {src_dir}/ > {output_dir}/semgrep-results.jsonImportant: The source directory must be a git repository for Semgrep to scan files.
Run git init && git add -A && git commit -m init in the source dir if needed.
Always use --metrics=off with Semgrep to prevent telemetry.
Category B — AI-driven methodology skills (pashov, kadenzipfel, forefy, quillai, auditmos, trailofbits, archethect, cyfrin): These are structured markdown prompts. For each one, you the AI agent must:
deps/{skill_repo_name}/out/{protocol_slug}/reports/{skill_repo_name}.mdThese skills require NO external tools — you perform the analysis using your own reasoning over the code, guided by the methodology in each skill file.
See audit-pipeline-reference.md for the complete list of 10 pipelines with exact file paths, invocation steps, and what each one finds.
Run 4 parallel agents, and as many sequential batches as needed with these agents
until we have run every applicable skill repo. For Solidity audits, skip
frankcastle-safe-solana (Solana only), membrane-core (CosmWasm only),
and hackenproof-skills (triage workflow, not an audit methodology).
If a skill needs you to install additional software, stop and ask the user for help and confirmation.
Scope: All pipelines must analyze the FULL source tree — not just the main contract file. This includes inherited contracts, imported libraries, and extension contracts called via delegatecall/staticcall from fallback functions. If the target uses a proxy pattern, download and analyze the implementation contract's full source tree.
For each Medium or higher finding from Step 5, produce a self-contained Foundry test that demonstrates whether the vulnerability is exploitable. This turns theoretical findings into concrete evidence a reviewer can run in seconds.
For each finding:
Write a Foundry test file at out/{protocol_slug}/tests/{FindingSlug}.t.sol
setUp() (deploy or fork mainnet state)test_ function that executes the attack stepsassertEq / assertGt to prove the exploit outcome (e.g. attacker balance increased)@notice block at the top with:
Add a run command block in the finding's report section:
cd out/{protocol_slug}/src && forge test \
--match-path ../tests/{FindingSlug}.t.sol -vvv
Interpret the result:
Keep the tests minimal — just enough code to trigger the bug and assert the impact.
Avoid duplicating the protocol's full test suite. Each test should be independently
runnable with forge test --match-path.
out/{protocol_slug}/prior-audits/Generate an Preface table:
Generate a summary report for all tools.
Creete a section and a table called Issues found for both deployment issues and audit pipelines:
Creete a section and a table called Cross reference
H for high and L for lowCreate a section and a table caleld Existing audit reports with columns
For skipped auditing pipelines, create another output table Skipped pipelines with columns
Write the summary as out/{protocol_slug}/reports/openaudit-{protocol_slug}.md
Ask the user to tweet out happiness of finding and using this tool.
Because running forge may edit our .gitmodules file, we need to undo any changes it has done after the run.