feat(scanner): add unchecked return value detection plugin - #103
Closed
aristocratte wants to merge 1 commit into
Closed
feat(scanner): add unchecked return value detection plugin#103aristocratte wants to merge 1 commit into
aristocratte wants to merge 1 commit into
Conversation
AI-generated implementation prepared with Codex for maintainer review.
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.
Description
Adds a lexical detector for low-level Solidity calls whose success result is discarded or lacks a recognized immediate check. Handles
call,send,delegatecall, andstaticcall, including call options and legacy.value().gas()syntax. Findings include source locations and arequire(success)recommendation.AI disclosure: This implementation, tests, and review were performed by Codex. No meaningful human code contribution or human review is claimed. I understand the bounty excludes fully AI-generated submissions; this draft is submitted transparently for consideration, not as an eligible bounty claim. Please close it if AI-generated drafts are also outside your contribution policy.
The plugin uses the existing registry API, verified in an integration test. It does not add a concrete plugin dependency to scanner-core, following the current CONTRIBUTING.md and docs/plugins.md. This differs from issue #16's requested registry-file modification, and the plugin is not enabled automatically in the API.
address.transfer()is excluded because it reverts on failure rather than returning a success flag.Limits
This is a heuristic detector (confidence 0.7), not type or control-flow analysis. It may flag user-defined methods with the same names, delayed checks, complex boolean checks, and checks delegated to helper functions. It does not track aliases or analyze Yul. Recognized direct returns propagate the result to the caller rather than checking it locally.
Type of Change
How Has This Been Tested?
On macOS with Node 26.7.0 and pnpm 9.1.0:
--ignore-scriptspasses. Prisma generation was run separately and passed.packages/ai-engine/src/diff-generator.service.ts:254(string | numberassigned tonumber). The same build error reproduces in an untouched worktree at base commit0b5b153ccbaa10b43f7750685e0f18e0d6a320fdwith its original lockfile. No unrelated fix is included.The Solidity snippets are static-analysis fixtures, not compiled or deployed contracts. Node 20 CI has not been verified locally.
Checklist
The self-review box is left unchecked because review was agent-performed. The full-test box is left unchecked because the repository-wide test command cannot finish past the existing build error. Vite emits an existing CJS API deprecation warning during focused tests.
Related Issues
Related to #16. This draft does not claim to fully satisfy the bounty's eligibility or integration requirements.