chore(audit): add static analysis sweep script#7
Merged
Conversation
Mirror of frontend/scripts/audit-static.sh adapted for the V2 (Leptos / Rust) codebase. 9 grep-shaped rules covering bug classes we've actually shipped here: 1. hardcoded chain naming literals (verify site-identity vs network-aware) 2. hardcoded grpc endpoints outside config.rs 3. hardcoded scan domains (verify intentional) 4. explorer URL with ?network= before path (V1 bug class — preventive) 5. .unwrap()/.expect() in app paths (WASM panics blank-screen) 6. todo!()/unimplemented!() macros in shipped code 7. println!/eprintln!/dbg! left in code (use leptos::logging) 8. TODO/FIXME/XXX/HACK markers 9. raw JSON-RPC use outside the EVM bridge layer Whitelists encoded for known-intentional patterns: api/evm.rs as the hand-rolled JSON-RPC bridge for EVM-shaped reads, main.rs for the axum startup banner, leptos use_context().expect() context-boot idiom. Verified: 0 hard errors on current main. Run from repo root: bash scripts/audit-static.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirror of
frontend/scripts/audit-static.shadapted for the V2 (Leptos / Rust) codebase. 9 grep-shaped rules covering bug classes we've actually shipped here.Rules
config.rs?network=before path (V1 bug class — preventive).unwrap()/.expect()in app paths (WASM panic = blank screen)todo!()/unimplemented!()in shipped codeprintln!/eprintln!/dbg!left in codeTODO/FIXME/XXX/HACKmarkersWhitelists encoded
api/evm.rs— hand-rolled JSON-RPC bridge for EVM-shaped reads (eth_calletc don't have gRPC equivalents; alloy-providers would add ~400 KB gzipped WASM)main.rs— axum startup banner useseprintln!(conventional)use_context().expect()— context-boot idiom (provider guaranteed at app root)Run
```bash
bash scripts/audit-static.sh
```
Exit code = number of hard errors. CI can
set -eon it.Verified
0 hard errors on current
main. Yellow output is review-only and reflects intentional design (site-identity branding, leptos context idiom, EVM bridge layer).Test plan
bash scripts/audit-static.sh; echo \$?returns 0 on main