cognis-digital/gasprofiler
GitHub: cognis-digital/gasprofiler
一款面向 Solidity 智能合约的 gas 分析与退化检测工具,按 opcode 和函数维度标记无界循环等高风险模式并支持 CI 基线拦截。
Stars: 0 | Forks: 0
analyze + score] P --> OUT[report] ``` ## 从任何 AI 技术栈中使用 `gasprofiler` 可以与所有流行的 AI 使用方式互操作: - **MCP server** — `gasprofiler mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **OpenAI 兼容 / JSON** — 将 `gasprofiler scan . --format json` 通过管道传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 用一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出代码 + SARIF ## 对比 | | **Cognis gasprofiler** | Foundry gas snapshots | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生支持(AI agent) | ✅ | ❌ | | 多语言移植(JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 | *秉承 **Foundry gas snapshots / hardhat-gas-reporter** 的精神,以 Cognis 的方式重新构建。漏掉了谁的致谢?提交一个 PR 吧。* ## 集成 接入您的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI agent 的 **MCP server**(`gasprofiler mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。参见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。 ## 安装 — 各种方式,各个平台 ``` pip install "git+https://github.com/cognis-digital/gasprofiler.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/gasprofiler.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/gasprofiler.git" # uv pip install cognis-gasprofiler # PyPI (when published) docker run --rm ghcr.io/cognis-digital/gasprofiler:latest --help # Docker brew install cognis-digital/tap/gasprofiler # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/gasprofiler/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/gasprofiler` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) | ## 相关 Cognis 工具 - [`reentryx`](https://github.com/cognis-digital/reentryx) — 静态 + 符号化检测器,可标记 Solidity/Vyper 中的重入、跨函数和只读重入路径,并输出支持 CI 拦截的 SARIF。 - [`forkfuzz`](https://github.com/cognis-digital/forkfuzz) — 主网分叉的不变性模糊测试工具,针对实时状态和有状态序列重放您的合约,在部署前打破协议不变性。 - [`approvewarden`](https://github.com/cognis-digital/approvewarden) — 扫描任何钱包中危险的 ERC-20/721/1155 代币授权和无限额度,评估资产被盗风险并生成撤销交易。 - [`mevscope`](https://github.com/cognis-digital/mevscope) — 重放交易或地址历史,以归因三明治攻击、抢跑和尾跑的 MEV 提取,并进行每笔交易的损失核算。 - [`rugradar`](https://github.com/cognis-digital/rugradar) — 代币合约风险扫描器,在您盲目投资前检测蜜罐、隐藏的 mint/blacklist 函数、所有者后门以及未锁定的流动性。 - [`storagelens`](https://github.com/cognis-digital/storagelens) — 在代理升级期间对比和解码合约存储布局,以捕获存储冲突和未初始化插槽漏洞。 **探索全套工具 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram) ## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件组合使用 — JSON 输入/输出以及共享的 OpenAI 兼容 `/v1` 骨干网络。参见 **[INTEROP.md](INTEROP.md)** 获取 套件图谱、组合模式和参考技术栈。 ## 许可证 在 **Cognis 开放协作许可证 (COCL) v1.0** 下提供源码 — 可免费用于个人、内部评估、研究和教育用途;**商业/生产环境使用需要获得许可证** (licensing@cognis.digital)。参见 [LICENSE](LICENSE)。
Cognis Digital · 包含 170+ 工具的 Cognis Neural Suite 之一 · Making Tomorrow Better Today
标签:Gas优化, Solidity, 以太坊, 可视化界面, 性能分析, 数据可视化, 日志审计, 智能合约, 请求拦截, 逆向工具