Build GitHub Action: NEAR Contract Security Scan
Description
## Overview
Create a GitHub Action that scans NEAR smart contracts for common vulnerabilities and security issues as part of CI/CD.
## Why This Matters
Smart contract security is critical. Automated scanning catches common issues before deployment, protecting users and building trust.
## Technical Requirements
### Action Usage
```yaml
- name: Security Scan
uses: near-actions/security-scan@v1
with:
contract-path: ./contracts
severity-threshold: medium # fail on medium+ issues
output-format: sarif # or json, markdown
```
### Vulnerability Checks
1. **Reentrancy patterns** - Though NEAR prevents classic reentrancy
2. **Integer overflow** - Unchecked arithmetic
3. **Access control** - Missing permission checks
4. **Panic conditions** - Unbounded operations
5. **Storage costs** - Potential storage attacks
6. **Cross-contract call safety** - Callback handling
7. **Upgrade safety** - Migration vulnerabilities
### Output
```
## Security Scan Results
### High Severity (1)
- **Unchecked arithmetic** in token.rs:45
Multiplication may overflow. Use checked_mul.
### Medium Severity (2)
- **Missing access control** in admin.rs:23
set_owner can be called by anyone.
### Low Severity (3)
...
```
## Deliverables
1. **GitHub Action** with security rules
2. **10+ vulnerability patterns** checked
3. **SARIF output** for GitHub Security tab
4. **Customizable severity thresholds**
## Budget: 8 NEAR