360 Secure SkillHub
360 安全技能中心

smart-contract-security-audito

面向 Solidity 与 Go(Cosmos/Hyperledger)智能合约的安全技能,包含三条工作流:静态安全审计(重入、溢出、权限、确定性等)、Gas 与状态读写性能优化建议,以及自动生成 Foundry(.t.sol)或 Go(_test.go)测试。需用户提供合约文件路径并自行复核结论。

shangter666
shangter666
热度 61.62
最近更新 2026-05-11 17:32:45
分类:安全依赖:读写文件 / 内部调用大模型应用场景:代码审查 / 代码生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add smart-contract-security-auditor
Metadata
name
smart-contract-security-auditor
description
Smart Contract Security Auditor: Analyzes Solidity and Go smart contracts for security vulnerabilities, provides gas optimization suggestions, and generates corresponding test cases (Foundry or Go tests).

smart-contract-security-auditor

A skill designed to enhance smart contract security, optimize gas costs, and ensure thorough test coverage for Solidity and Golang (Cosmos/Hyperledger) projects.

Workflows

1. Security Static Analysis

When you finish writing or modifying a smart contract, trigger this skill to analyze the code for common vulnerabilities.

  • For Solidity, it checks for reentrancy, overflow, access control issues, and more.
  • For Go, it checks for determinism issues and state access control.

How to trigger: "Audit this contract: [file_path]" or "Check my changes in [file_path] for security vulnerabilities."

2. Gas & Performance Optimization

Use this workflow to get suggestions on reducing EVM Gas costs or optimizing state read/write operations in Cosmos/Hyperledger.

How to trigger: "Optimize gas for [file_path]" or "Suggest performance improvements for [file_path]."

3. Automatic Test Generation

Whenever contract logic changes, this skill can automatically generate or update the corresponding tests.

  • Solidity: Generates Foundry tests (.t.sol).
  • Go: Generates Go tests using the testing package (_test.go).

How to trigger: "Generate tests for [file_path]" or "Write a Foundry test script for my new logic."

Reference Materials

When performing tasks, reference the following documents to ensure standard compliance:

Usage Guidelines

  • Be Explicit: If you want both an audit and test generation, ask for both (e.g., "Audit this file and write tests for it").
  • Review Findings: The auditor will present findings and suggestions. Review them before requesting code changes.
  • Test Context: When generating tests for Go, ensure you provide context on the specific framework (Cosmos SDK vs. Hyperledger Fabric) if it's not obvious from the code.