Token导航 LogoToken导航TokenDH.com
研究检索可写文件clawhub未标认证来源可访问clear审计提醒

solidity-guardian坚固守护者

Agent Skill

solidity-guardian 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

26,183

周安装

1,049

GitHub Stars

公开资料未说明

下载量

8,476
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:solidity-guardian(坚固守护者)
来源仓库:https://github.com/aviclaw/solidity-guardian
安装命令:
openclaw skills install solidity-guardian
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install solidity-guardian

简介

智能合约安全分析技能可检测漏洞并生成审核报告。

  • 基于模式匹配与规则引擎识别潜在风险点如权限缺失或状态不一致。
  • 支持 Hardhat/Foundry 项目结构,输出可读性强的问题分类列表。
  • 修复建议需结合实际业务逻辑验证有效性。solidity-guardian 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 不替代完整审计流程,适用于快速自查阶段。

SKILL.md

name
solidity-guardian
version
1.0.0
description
Smart contract security analysis skill. Detect vulnerabilities, suggest fixes, generate audit reports. Supports Hardhat/Foundry projects. Uses pattern matching + best practices from Trail of Bits, OpenZeppelin, and Consensys.
author
aviclaw
tags

Solidity Guardian 🛡️

Security analysis for Solidity smart contracts. Find vulnerabilities, get fix suggestions, follow best practices.

Quick Start

# Analyze a single contract
node skills/solidity-guardian/analyze.js contracts/MyContract.sol

# Analyze entire project
node skills/solidity-guardian/analyze.js ./contracts/

# Generate markdown report
node skills/solidity-guardian/analyze.js ./contracts/ --format markdown > AUDIT.md

What It Detects (40+ Patterns)

Critical (Must Fix)

IDVulnerabilityDescription
SG-001ReentrancyExternal calls before state updates
SG-002Unprotected selfdestructMissing access control on selfdestruct
SG-003Delegatecall to untrustedDelegatecall with user-controlled address
SG-004Uninitialized storage pointerStorage pointer overwrites slots
SG-005Signature replayecrecover without nonce/chainId
SG-006Arbitrary jumpFunction type from user input

High (Should Fix)

IDVulnerabilityDescription
SG-010Missing access controlPublic functions that should be restricted
SG-011Unchecked transferERC20 transfer without return check
SG-012Integer overflowArithmetic without SafeMath (pre-0.8)
SG-013tx.origin authUsing tx.origin for authentication
SG-014Weak randomnessblock.timestamp/blockhash for randomness
SG-015Unprotected withdrawalWithdrawal without ownership check
SG-016Unchecked low-level call.call() without success check
SG-017Dangerous equalityStrict balance check (manipulable)
SG-018Deprecated functionssuicide, sha3, throw, callcode
SG-019Wrong constructorFunction name matches contract

Medium (Consider Fixing)

IDVulnerabilityDescription
SG-020Floating pragmaNon-pinned Solidity version
SG-021Missing zero checkNo validation for zero address
SG-022Timestamp dependenceLogic depends on block.timestamp
SG-023DoS with revertLoop with external call can revert
SG-024Front-running riskPredictable state changes

Low (Best Practice)

IDVulnerabilityDescription
SG-030Missing eventsState changes without events
SG-031Magic numbersHardcoded values without constants
SG-032Implicit visibilityFunctions without explicit visibility
SG-033Large contractContract exceeds size recommendations
SG-034Missing NatSpecPublic functions without documentation

Usage Examples

Basic Analysis

const { analyzeContract } = require('./analyzer');

const results = await analyzeContract('contracts/Token.sol');
console.log(results.findings);

With Fix Suggestions

const results = await analyzeContract('contracts/Vault.sol', {
  includeFixes: true,
  severity: ['critical', 'high']
});

for (const finding of results.findings) {
  console.log(`[${finding.severity}] ${finding.title}`);
  console.log(`  Line ${finding.line}: ${finding.description}`);
  console.log(`  Fix: ${finding.suggestion}`);
}

Generate Report

const { generateReport } = require('./reporter');

const report = await generateReport('./contracts/', {
  format: 'markdown',
  includeGas: true,
  includeBestPractices: true
});

fs.writeFileSync('SECURITY_AUDIT.md', report);

Best Practices Checklist

When writing secure contracts, follow these guidelines:

Access Control

  • [ ] Use OpenZeppelin's Ownable or AccessControl
  • [ ] Apply onlyOwner or role checks to sensitive functions
  • [ ] Implement two-step ownership transfer
  • [ ] Consider timelocks for critical operations

Reentrancy Prevention

  • [ ] Use ReentrancyGuard on all external-facing functions
  • [ ] Follow checks-effects-interactions pattern
  • [ ] Update state BEFORE external calls
  • [ ] Use pull over push for payments

Input Validation

  • [ ] Validate all external inputs
  • [ ] Check for zero addresses
  • [ ] Validate array lengths match
  • [ ] Use SafeERC20 for token transfers

Arithmetic Safety

  • [ ] Use Solidity 0.8+ or SafeMath
  • [ ] Check for division by zero
  • [ ] Validate percentage calculations (≤100)
  • [ ] Be careful with token decimals

Upgradeability (if applicable)

  • [ ] Use initializer instead of constructor
  • [ ] Protect initialize from re-initialization
  • [ ] Follow storage layout rules
  • [ ] Test upgrade paths

Slither Integration

Guardian can run alongside Slither for comprehensive analysis:

# Combined analysis (auto-installs Slither if missing)
node skills/solidity-guardian/slither-integration.js ./contracts/ --install-slither

# Generate combined report
node skills/solidity-guardian/slither-integration.js . --format markdown --output AUDIT.md

# Guardian only (faster, no Slither dependency)
node skills/solidity-guardian/slither-integration.js ./contracts/ --guardian-only

# Slither only
node skills/solidity-guardian/slither-integration.js ./contracts/ --slither-only

Why both?

  • Guardian: Fast pattern matching, custom rules, no compilation needed
  • Slither: Deep dataflow analysis, CFG-based detection, more comprehensive

Integration with Other Tools

Hardhat

// hardhat.config.js
require('./skills/solidity-guardian/hardhat-plugin');

// Run: npx hardhat guardian

Foundry

# Add to CI
forge build
node skills/solidity-guardian/analyze.js ./src/

References


Built by Avi 🔐 | Security-first, ship always.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

92.95%
按下载量换算7,878

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills