|
| 1 | +# Pull Request Template |
| 2 | + |
| 3 | +## π Description |
| 4 | +<!-- Provide a brief description of the changes in this PR --> |
| 5 | + |
| 6 | +## π Type of Change |
| 7 | +- [ ] π Bug fix (non-breaking change that fixes an issue) |
| 8 | +- [ ] β¨ New feature (non-breaking change that adds functionality) |
| 9 | +- [ ] β οΈ Breaking change (fix or feature that would cause existing functionality to change) |
| 10 | +- [ ] π Documentation update |
| 11 | +- [ ] π Security improvement |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## π SECURITY REVIEW (β MANDATORY FOR SMART CONTRACT CHANGES) |
| 16 | + |
| 17 | +**For all smart contract code changes, complete the following checklist.** |
| 18 | + |
| 19 | +See [`docs/SECURITY_CHECKLIST.md`](/docs/SECURITY_CHECKLIST.md) for detailed guidance. |
| 20 | + |
| 21 | +### Required: Security Checklist Sign-Off |
| 22 | +- [ ] **I have reviewed this PR against the Internal Security Checklist** (`docs/SECURITY_CHECKLIST.md`) |
| 23 | + - [ ] Reentrancy: Verified Checks-Effects-Interactions (CEI) pattern |
| 24 | + - [ ] Access Control: Confirmed all sensitive functions are protected (`onlyOwner`, `onlyRole()`, etc.) |
| 25 | + - [ ] Input Validation: Validated all parameters have appropriate bounds checks |
| 26 | + - [ ] Unchecked Returns: All external calls have return value checks (`require(success, ...)`) |
| 27 | + - [ ] Gas Limits: No unbounded loops or potential DOS vectors |
| 28 | + |
| 29 | + **If any checkbox cannot be verified, explain below:** |
| 30 | + ``` |
| 31 | + [Explanation here] |
| 32 | + ``` |
| 33 | + |
| 34 | +### Slither Static Analysis Results |
| 35 | +- [ ] Ran Slither locally: `slither . --config-file slither.config.json` |
| 36 | + - **Result**: β
No High/Medium findings OR π‘ Documented false positives (see below) |
| 37 | + |
| 38 | +- [ ] GitHub Actions Slither workflow passed: |
| 39 | + - π’ All High/Medium findings fixed OR |
| 40 | + - π‘ All false positives documented with FP references |
| 41 | + |
| 42 | + **If this PR has security findings, document them below:** |
| 43 | + |
| 44 | +### Handling Security Findings |
| 45 | + |
| 46 | +#### Option A: Fixed in This PR β
|
| 47 | +- [ ] Vulnerability identified and resolved |
| 48 | +- [ ] Test case added to verify fix |
| 49 | +- [ ] Explain fix below: |
| 50 | + ``` |
| 51 | + [Explanation of fix] |
| 52 | + ``` |
| 53 | + |
| 54 | +#### Option B: False Positive π‘ |
| 55 | +- [ ] Identified as false positive (tool limitation or misleading check) |
| 56 | +- [ ] Added entry to `contracts/.false-positives.md` with: |
| 57 | + - Detector rule name |
| 58 | + - Technical reasoning (3+ sentences why it's safe) |
| 59 | + - Evidence (code snippet, test case, or reference) |
| 60 | +- [ ] Reference number (e.g., FP-001): |
| 61 | + ``` |
| 62 | + [FP number and explanation] |
| 63 | + ``` |
| 64 | +- [ ] Inline suppression added to code: |
| 65 | + ```solidity |
| 66 | + // slither-disable-next-line <detector-name> |
| 67 | + // Reason: [one-line reason] |
| 68 | + ``` |
| 69 | + |
| 70 | +#### Option C: Accepted Risk β οΈ |
| 71 | +- [ ] Acknowledged as low-priority style issue (naming conventions, etc.) |
| 72 | +- [ ] Added to Slither exclusions |
| 73 | +- [ ] Explain below: |
| 74 | + ``` |
| 75 | + [Explanation] |
| 76 | + ``` |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## π Testing |
| 81 | + |
| 82 | +### Functional Testing |
| 83 | +- [ ] Unit tests added/updated for changes |
| 84 | +- [ ] Integration tests passing |
| 85 | +- [ ] Manual testing completed and documented below: |
| 86 | + ``` |
| 87 | + [Testing steps or scenarios] |
| 88 | + ``` |
| 89 | + |
| 90 | +### Security Testing |
| 91 | +- For state-changing functions: |
| 92 | + - [ ] Reentrancy test (if applicable): Verify re-entry is blocked |
| 93 | + - [ ] Access control test: Verify unauthorized access is rejected |
| 94 | + - [ ] Boundary test: Verify edge cases are handled |
| 95 | + |
| 96 | +- For external integrations: |
| 97 | + - [ ] Return value verification test |
| 98 | + - [ ] Failure scenario test |
| 99 | + |
| 100 | +### Test Coverage |
| 101 | +- [ ] All new code paths have test coverage |
| 102 | +- [ ] Security-critical paths have comprehensive test cases |
| 103 | +- [ ] Coverage report: `[Link or reference]` |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## π Deployment Notes |
| 108 | + |
| 109 | +<!-- Any deployment considerations, migration steps, or special instructions --> |
| 110 | + |
| 111 | +### Mainnet Readiness |
| 112 | +- [ ] This code is ready for production deployment |
| 113 | +- [ ] All critical tests pass |
| 114 | +- [ ] Security review approved |
| 115 | +- [ ] No temporary debug code |
| 116 | +- [ ] No TODO comments |
| 117 | + |
| 118 | +### Breaking Changes |
| 119 | +If this PR introduces breaking changes: |
| 120 | +- [ ] Migration guide provided |
| 121 | +- [ ] Deprecation period defined: `[timeframe]` |
| 122 | +- [ ] Legacy code deprecated with warnings |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## π Automated Scan Results |
| 127 | + |
| 128 | +<!-- GitHub Actions will update this section --> |
| 129 | + |
| 130 | +### Slither Analysis |
| 131 | +- β Status: [Pending workflow execution] |
| 132 | +- π΄ High/Medium findings: [Number] ([View in Security tab](../../security/code-scanning)) |
| 133 | +- π‘ Low/Informational findings: [Number] |
| 134 | +- π’ No issues detected: [If applicable] |
| 135 | + |
| 136 | +### Related Documentation |
| 137 | +- [Security Checklist](docs/SECURITY_CHECKLIST.md) β Use for code review |
| 138 | +- [False Positive Process](docs/FALSE_POSITIVE_HANDLING.md) β For non-vulnerabilities |
| 139 | +- [Slither Configuration](slither.config.json) β Current scanner settings |
| 140 | + |
| 141 | +--- |
| 142 | + |
| 143 | +## β
Reviewer Checklist |
| 144 | + |
| 145 | +**For code reviewers** (use this to guide your security-focused review): |
| 146 | + |
| 147 | +- [ ] PR author completed security checklist β |
| 148 | +- [ ] All findings documented and categorized (fixed/false positive/excluded) |
| 149 | +- [ ] Inline security comments are clear and justified |
| 150 | +- [ ] Tests cover security-critical code paths |
| 151 | +- [ ] No external calls bypass return value checks |
| 152 | +- [ ] Access control is properly enforced |
| 153 | +- [ ] State updates follow CEI pattern |
| 154 | +- [ ] Input validation is comprehensive |
| 155 | +- [ ] Follow-up actions (if any) tracked in issues |
| 156 | + |
| 157 | +--- |
| 158 | + |
| 159 | +## π Questions or Issues? |
| 160 | + |
| 161 | +- π€ Confused about security checklist? β See [`docs/SECURITY_CHECKLIST.md`](/docs/SECURITY_CHECKLIST.md) |
| 162 | +- π Marking finding as false positive? β Follow [`docs/FALSE_POSITIVE_HANDLING.md`](/docs/FALSE_POSITIVE_HANDLING.md) |
| 163 | +- π Need security review help? β Tag `@security-team` in comments |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## π Pre-Submit Checklist |
| 168 | + |
| 169 | +Before marking PR as ready for review: |
| 170 | + |
| 171 | +- [ ] Description is clear and concise |
| 172 | +- [ ] All security checklist items checked (β
or explanation provided) |
| 173 | +- [ ] All tests passing locally: `npm test` |
| 174 | +- [ ] Linter passing: `npm run lint` |
| 175 | +- [ ] Slither passing locally OR findings documented: `slither . --config-file slither.config.json` |
| 176 | +- [ ] Code follows project style guide |
| 177 | +- [ ] No merge conflicts |
| 178 | +- [ ] Commits are clean and well-documented |
| 179 | +- [ ] Branch is up-to-date with main/develop |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +**β
Ready for Review?** Ensure all items above are checked before requesting review. |
| 184 | + |
0 commit comments