一键导入
security-review
Comprehensive security audit of SaThuCoin contract, dependencies, deployment scripts, and scraper code. Only invoke manually — never auto-trigger.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Comprehensive security audit of SaThuCoin contract, dependencies, deployment scripts, and scraper code. Only invoke manually — never auto-trigger.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run gas analysis on contract functions and report costs. Use when the user asks about gas usage, optimization, or contract efficiency.
Compile Solidity contracts and run the full test suite. Use when the user asks to test, run tests, or verify changes work.
| name | security-review |
| description | Comprehensive security audit of SaThuCoin contract, dependencies, deployment scripts, and scraper code. Only invoke manually — never auto-trigger. |
| disable-model-invocation | true |
| user-invocable | true |
| allowed-tools | Read, Grep, Glob, Bash(npm audit), Bash(npm list *), Bash(npm run compile), Bash(npm run test:gas) |
| argument-hint | [scope: all | contract | deps | deploy | scraper] |
Perform a methodical, comprehensive security review of the SaThuCoin project. This is a read-only audit. Do not modify any files. Report findings only.
Parse $ARGUMENTS to determine review scope:
| Argument | Scope | Domains Audited |
|---|---|---|
(empty) or all | Full project | A + B + C + D + E + F |
contract | Smart contract | A only |
deps | Dependencies | C only |
deploy | Deployment scripts | B + E |
scraper | Scraper/minter | D + E |
Files to read: contracts/SaThuCoin.sol, test/SaThuCoin.test.js
Reference: docs/SaThuCoin comprehensive security deep dive.md (sections 1-2)
onlyOwner or role-based modifiermint(), burn(), or _mint() callsOwnable(msg.sender)tx.origin for authenticationSearch for anti-patterns:
Grep for: tx.origin
Grep for: function.*public|external (verify each has access control or is view/pure)
ERC20Capped is used (supply limit)_mint calls)burn functionality and its access controlSearch for:
Grep in contracts/: _mint
Grep in contracts/: _burn
Grep in contracts/: totalSupply
ERC20Pausable is inheritedpause() and unpause() exist with proper access controlOwnable2Step is used (vs single-step Ownable)import "...")require(..., "string"))external visibility preferred over public for gas efficiencycalldata used for string/bytes parametersselfdestruct usagedelegatecall usage@custom:security-contact NatSpec tag present_update() override resolves diamond inheritance correctly (when ERC20Capped + ERC20Pausable)super._update() calls presentRead test/SaThuCoin.test.js and verify:
mint(address(0), amount)).withArgs()Files to read: scripts/deploy.js, scripts/verify.js, hardhat.config.js
Reference: Gap Analysis (section 2.4)
console.log.*key|secret|private)Search for:
Grep in scripts/: 0x[a-fA-F0-9]{64} (private key pattern)
Grep in scripts/: hardcoded|password|secret|mnemonic
Grep in scripts/: console.log
data/ (gitignored)Read hardhat.config.js:
Files to read: package.json, package-lock.json, .npmrc (if exists)
Reference: Security Deep Dive section 3, Security Rules "npm Supply Chain"
Read package.json and check:
^ or ~ in any dependency version (production OR dev)"package": "1.2.3" not "^1.2.3"package-lock.json exists and is committed.npmrc exists with ignore-scripts=trueaxios, cheerio, node-cron actually imported anywhere?Grep for: require.*axios
Grep for: require.*cheerio
Grep for: require.*node-cron
npm audit and report findingsFor each dependency, verify:
Known high-risk npm incidents to be aware of:
Files to read: scraper/**/*.js, cli/**/*.js (if they exist)
Reference: Security Deep Dive sections 3-5, Project Plan Phases 5-7
ethers.getAddress() (EIP-55 checksum)/0x[0-9a-fA-F]{40}/config/rewards.json maxMintsPerCycle)Grep in scraper/: PRIVATE_KEY
Grep in scraper/: console.log
Files to search: entire repo Reference: Security Rules "Secrets & Key Management"
Read .gitignore and verify:
.env and .env.* are gitignoreddata/ directory is gitignorednode_modules/ is gitignoredBash: git log --all --diff-filter=A -- "*.env" ".env*"
.env files ever committed in git historyRead all files in config/:
Files to read: .claude/CLAUDE.md, .claude/settings.json, .claude/rules/*.md, .claude/hooks/*
Reference: Security Deep Dive section 6, Security Rules "AI Agent Security"
Read .claude/settings.json:
.env read/edit deniedrm -rf, git push --force, git reset --hard)Read .claude/hooks/post-edit.sh:
.env, secret, credential patternsRead .claude/rules/security.md:
After completing all applicable domain checks, produce a report in this structure:
# SaThuCoin Security Review Report
**Date:** [current date]
**Scope:** [what was reviewed]
**Reviewer:** Claude Code /security-review skill
## Summary
- CRITICAL findings: [count]
- HIGH findings: [count]
- MEDIUM findings: [count]
- LOW/INFO findings: [count]
## Findings
### [SEVERITY] Finding Title
- **Domain:** [A/B/C/D/E/F]
- **File:** [file path:line number]
- **Description:** [what's wrong]
- **Risk:** [what could happen]
- **Recommendation:** [how to fix]
- **Reference:** [link to relevant security doc section]
[Repeat for each finding...]
## Checklist Results
[Domain A checklist with pass/fail marks]
[Domain B checklist with pass/fail marks]
[...]
## Recommendations (Prioritized)
1. [Most critical action]
2. [Next most critical]
3. [...]
docs/SaThuCoin comprehensive security deep dive.md to check if the project follows its own security recommendations.