Fix sanctifier-core build/clippy failures; add constant folding, gas exhaustion rule, and CFG-based taint analysis - #1065
Merged
Gbangbolaoluwagbemiga merged 1 commit intoJun 28, 2026
Conversation
…exhaustion rule, and CFG-based taint analysis Fixes the unused-import and missing-Debug-derive clippy failures blocking `make lint`/`cargo build` on sanctifier-core, suppresses trivial constant-folded arithmetic warnings (e.g. 1000 + 500), adds the S031 Gas Exhaustion Risk rule for unbounded user-controlled loops, and replaces the single-pass AST taint walker with an intra-procedural CFG and fixed-point taint dataflow engine so taint introduced inside loop bodies or only one if-branch is no longer missed. Closes #490 Closes #402 Closes #403 Closes #401 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@devsimze is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@devsimze Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
sanctifier-corebuild/clippy failures blockingmake lintandcargo build: removed an unusedSpannedimport incontract_discovery.rs, added#[derive(Debug)]toparser::ParsedSource(required by.unwrap_err()in tests), and fixed aclippy::len_zerolint insep41_tests.rs. Verified clean undercargo build -p sanctifier-core --all-features,cargo clippy --workspace --all-targets --all-features -- -D warnings, andcargo test -p sanctifier-core --all-features.constant_folding.rs) that evaluates literal-only arithmetic at analysis time, so trivial expressions like1000 + 500are no longer flagged by the S003 arithmetic-overflow rule.rules/gas_exhaustion.rs), detectingfor/whileloops whose bound traces back to an unbounded user-controlled parameter (Vec,Map,Bytes, or raw integers) without a clamp (.min(),.take(), etc.). Note: the issue text requested codeS012, but that code is already assigned toSEP41_INTERFACE_DEVIATION, so the next free codeS031was used instead.cfg.rs) and a fixed-point taint dataflow engine (taint_engine.rs), replacing the single-pass AST walker in the S026taint_propagationrule. This fixes a real gap where the old rule never visited loop bodies at all, so taint introduced inside afor/whileloop, or in only one branch of anif, was invisible. Intra-procedural only, as scoped by the issue.Test plan
cargo build -p sanctifier-core --all-featurescargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p sanctifier-core --all-features(342 lib tests + all integration/snapshot tests pass)Closes #490
Closes #402
Closes #403
Closes #401