ncreighton/2aa140e3-blockchain-smart-contract-audi
GitHub: ncreighton/2aa140e3-blockchain-smart-contract-audi
一个基于 FastAPI 的 Solidity 智能合约漏洞扫描 API 服务,帮助开发者和安全团队在秒级时间内完成合约安全初筛。
Stars: 0 | Forks: 0
# 区块链智能合约审计与漏洞扫描器 API
## 功能
- 完整的 REST API
## 快速开始
```
# 1. 安装 dependencies
pip install -r requirements.txt
# 2. 配置 environment
cp .env.example .env
# 编辑 .env 以设置你的配置
# 3. 本地运行
uvicorn main:app --reload --port 8000
# 4. 查看 interactive docs
open http://localhost:8000/docs
```
## Docker 部署
```
# Build 并运行
docker compose up -d
# Check health
curl http://localhost:8000/health
```
## 身份验证
首先获取 token:
```
curl -X POST "http://localhost:8000/auth/token?username=admin&password=admin123"
```
在后续请求中使用该 token:
```
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8000/items
```
## API 端点
| Method | Path | Description |
|--------|------|-------------|
| GET | `/health` | 系统健康状态 |
| POST | `/auth/token` | 获取 JWT token |
| GET | `/items` | 列出所有项目 |
| POST | `/items` | 创建项目 |
| GET | `/items/{id}` | 获取项目 |
| PATCH | `/items/{id}` | 更新项目 |
| DELETE | `/items/{id}` | 删除项目 |
| GET | `/stats` | API 统计信息 |
完整的交互式文档:`http://localhost:8000/docs`
## 速率限制
| Endpoint | Limit |
|----------|-------|
| `/auth/token` | 10次/分钟 |
| `GET /items` | 60次/分钟 |
| `POST /items` | 30次/分钟 |
| `DELETE /items` | 20次/分钟 |
## 运行测试
```
pip install pytest httpx
pytest tests/ -v
```
## 生产环境注意事项
- 在部署前更改 `.env` 中的 `SECRET_KEY`
- 将内存中的 `_db` 替换为真正的数据库
- 在 `auth.py` 中添加适当的用户管理
- 为 CORS 配置 `ALLOWED_ORIGINS`
- 使用 Nginx/Traefik 作为反向代理
## 许可证
MIT
### 升级到专业版
获取包含所有高级功能、优先支持和终身更新的完整版本。
**[获取专业版](https://buy.stripe.com/4gM28rh1BbUEe00eM4cZb3Q)**
- [立即购买 (Stripe)](https://buy.stripe.com/4gM28rh1BbUEe00eM4cZb3Q)
- [在 Whop 上购买](https://whop.com/blockchain-smart-contract-audit-and-vulnerability-scanner-api)
标签:API服务, AV绕过, CISA项目, DApp安全, Docker, Docker Compose, FastAPI, JWT认证, meg, Python, REST API, SAST, Solidity, Uvicorn, Web3安全, 代币合约检测, 代币安全, 企业级安全, 信息安全, 加密, 区块链安全, 合约漏洞分析, 威胁情报, 安全防御评估, 开发者工具, 无后门, 智能合约审计, 漏洞扫描器, 盲注攻击, 请求拦截, 逆向工具