---
allowed-tools: Bash, Read, Write
argument-hint: <contract name or project> [--network mainnet|testnet|l2]
description: "ชุดคำสั่งสำหรับ Checklist ก่อน Deploy ช่วยวิเคราะห์ วางขั้นตอน สร้างเอกสาร หรือดำเนินงานที่เกี่ยวข้องกับงาน Blockchain, Web3, Smart Contract, DeFi, Wallet และระบบกระจายศูนย์ ให้อ่านเข้าใจง่ายและนำไปใช้ต่อได้สะดวก"
---

# Checklist ก่อน Deploy

ชุดคำสั่งสำหรับ Checklist ก่อน Deploy ช่วยวิเคราะห์ วางขั้นตอน สร้างเอกสาร หรือดำเนินงานที่เกี่ยวข้องกับงาน Blockchain, Web3, Smart Contract, DeFi, Wallet และระบบกระจายศูนย์ ให้อ่านเข้าใจง่ายและนำไปใช้ต่อได้สะดวก

## Pre-Deployment Verification

### Code Quality
- [ ] All compiler warnings resolved (`solc --warnings-as-errors`)
- [ ] Slither static analysis run — no High/Critical findings open
- [ ] Mythril or Echidna fuzz testing completed
- [ ] Code reviewed by at least one other developer
- [ ] Natspec documentation complete for all public functions

### Testing
- [ ] Unit test coverage ≥ 95% for all critical functions
- [ ] Integration tests covering all user flows
- [ ] Edge case tests: zero values, max uint256, empty arrays
- [ ] Reentrancy tests for all external call sites
- [ ] Access control tests for all privileged functions
- [ ] Upgrade path tested (if using proxy pattern)

### Security Configuration
- [ ] Multisig wallet set as owner/admin (not EOA)
- [ ] Timelock on critical admin functions (≥ 24h for mainnet)
- [ ] Emergency pause functionality tested
- [ ] Withdrawal limits or rate-limiting in place
- [ ] Oracle source verified and manipulation-resistant

### Testnet Verification
- [ ] Deployed and tested on: _____ testnet
- [ ] All functions called successfully on testnet
- [ ] Gas estimates recorded and within budget
- [ ] Events emitted correctly and indexed as expected
- [ ] Frontend integration tested against testnet deployment

### Deployment Configuration
- [ ] Constructor arguments verified and documented
- [ ] Deployment script reviewed and tested
- [ ] Private keys secured (hardware wallet / multi-sig)
- [ ] Gas price strategy defined
- [ ] Deployment address pre-computed if needed (CREATE2)

### Post-Deployment Plan
- [ ] Contract address recorded in deployment registry
- [ ] Verification submitted to Etherscan / block explorer
- [ ] ABI saved and published
- [ ] Monitoring alerts configured (e.g., Tenderly, OpenZeppelin Defender)
- [ ] Incident response plan documented

### External Audit (Mainnet)
- [ ] Audit completed by reputable firm
- [ ] All Critical and High findings resolved
- [ ] Audit report published publicly

## Network-Specific Notes

| Network | Gas Price Source | RPC | Explorer |
|---|---|---|---|
| Ethereum Mainnet | EIP-1559 base + priority | ... | etherscan.io |
| Arbitrum | L2 fees apply | ... | arbiscan.io |
| Polygon | Check matic gas station | ... | polygonscan.com |
| Base | L2 fees apply | ... | basescan.org |

## Sign-Off

- Developer: _____ Date: _____
- Reviewer: _____ Date: _____
- Security Lead: _____ Date: _____
