near-contract-audit
Original:🇺🇸 English
Translated
Comprehensive security audit skill for NEAR Protocol smart contracts written in Rust. Use when auditing NEAR contracts, reviewing security vulnerabilities, or analyzing contract code for issues like reentrancy, unhandled promises, unsafe math, access control flaws, and callback security.
2installs
Sourcenear/agent-skills
Added on
NPX Install
npx skill4agent add near/agent-skills near-contract-auditTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →NEAR Contract Audit
Security audit skill for NEAR smart contracts in Rust.
Audit Workflow
Phase 1: Automated Analysis
Run your preferred Rust static analysis and NEAR-focused security tools on the contract to:
- Scan for common vulnerability patterns (reentrancy, unsafe math, unhandled promises, access control issues, etc.)
- Highlight potentially risky patterns for deeper manual review
Phase 2: Manual Review
After automated analysis, perform manual review for:
- Business logic vulnerabilities
- Access control patterns
- Economic attack vectors
- Cross-contract interaction safety
Phase 3: Code-Specific Analysis
For each finding, verify:
- Is it a true positive?
- What is the exploitability?
- What is the recommended fix?
Phase 4: Report Generation
Document findings with severity, location, description, and remediation.
Vulnerability Quick Reference
| Severity | Detector ID | Description |
|---|---|---|
| High | | Callback missing |
| High | | State change after cross-contract call |
| High | | Using native integer types in JSON interfaces |
| High | | Collection modifications not persisted |
| High | | Missing caller/owner verification |
| High | | Missing |
| High | | Same storage prefix for different collections |
| High | | Missing |
| Medium | | Unbounded loops causing DoS |
| Medium | | Predictable randomness from block data |
| Medium | | Insufficient gas reserved for callbacks |
| Low | | Missing storage deposit verification |
| Low | | Arithmetic without overflow checks |
| Low | | Using floating point types for financial math |
Reference Files
For detailed vulnerability documentation with code examples:
- high-severity.md - Critical vulnerabilities (8 detectors)
- medium-severity.md - Medium vulnerabilities (4 detectors)
- low-severity.md - Low severity findings (3 detectors)