Feat/903 soroban entrypoint analyzer - #947
Merged
mijinummi merged 1 commit intoAug 31, 2026
Merged
Conversation
|
@T-kesh 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! 🚀 |
Collaborator
|
Hi @T-kesh kindly fix the conflict |
Contributor
Author
I will get on that right away |
- Implement SorobanEntryPointAnalyzer in packages/analyzers/soroban/entrypoints - Add parameter extraction, authorization path tracking, storage and external call tracking - Implement entry-point rule validators in packages/rules/soroban/entrypoints - Add comprehensive unit tests covering all analyzer and rule capabilities
T-kesh
force-pushed
the
feat/903-soroban-entrypoint-analyzer
branch
from
August 31, 2026 17:45
7c265b7 to
2c04959
Compare
4 tasks
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.
Implement Soroban Contract Entry-Point Analyzer (#903)
Summary
This pull request implements the Soroban Contract Entry-Point Analyzer along with dedicated detection rules and unit tests. Entry points determine how users and external contracts interact with contract logic. This analyzer performs comprehensive static analysis of public and externally accessible Soroban contract entry points to extract function signatures and parameters, trace authorization paths, and monitor storage accesses and external/cross-contract invocations.
What Changed
1. Soroban Entry-Point Analyzer (
packages/analyzers/soroban/entrypoints/)types.ts: Comprehensive data structures for entry points, parameters (isEnv,isAddress,isAuthParam,isCollection,isMutable,isReference,docComment,isUnused), authorization checks (require_auth,require_auth_for_args,auth.authenticate,invoker), storage access (instance,persistent,temporary, reads/writes, keys, TTL extensions), external calls (invoke_contract,TokenClient, typed clients, balance queries, token transfers/mints/burns), and aggregate metrics.entry-point-analyzer.ts:#[contractimpl]blocks,impl Trait for Contractimplementations,impl Contractblocks,pub traitdeclarations, and standalonepub fnfunctions.public,constructor,internal,private) and identifies constructors/initializers (init,new,initialize).critical,high,medium,low,safe) and generates executive summaries.index.ts: Re-exports types and analyzer while preserving backward compatibility with the existing profile analyzer module.__tests__/entry-point-analyzer.spec.ts: 18 unit tests covering all analyzer requirements and edge cases.2. Soroban Entry-Point Rules (
packages/rules/soroban/entrypoints/)types.ts: Defines finding types, severity classifications, and report models.entry-point-rule.ts: Provides rule engine validators:soroban-unprotected-entry-point(Critical): Public state-mutating entry point lacking caller authorization.soroban-entry-point-call-in-loop(High): Cross-contract or token calls executed inside loop constructs.soroban-entry-point-storage-in-loop(High): Storage writes performed inside loop constructs.soroban-entry-point-auth-in-loop(Medium): Authorization checks placed inside loops.soroban-entry-point-redundant-auth(Low): Redundant multi-authorization checks on the same address.soroban-entry-point-unused-parameter(Low): Unreferenced parameters in public entry points.validateEntryPointAuthorization,validateEntryPointExternalCalls, andvalidateEntryPointStorage.index.ts: Exports rule functions and types.__tests__/entry-point-rule.spec.ts: 7 unit tests validating clean and vulnerable contracts.3. Package Integration
packages/rules/soroban/src/entrypoints/index.ts: Internal package export wrapper.packages/rules/soroban/src/index.ts: Re-exports entrypoints module for global rule engine consumers.Requirements & Acceptance Criteria Checklist
SorobanEntryPointAnalyzerandanalyzeEntryPointsfunction created.#[contractimpl]methods, trait implementations,pub fn, and constructors while distinguishing internal helper functions.isEnv,isAddress, collections (Vec,Map, etc.), mutability, references, and doc comments.require_auth,require_auth_for_args, auth in loops, redundant auth, parameter authorization mapping, and flags unprotected state mutations.env.invoke_contract,TokenClient, typed clients, transfers, mint/burn, balance queries, and calls in loops.Verification
All 10 pre-existing entry-point profiler tests continue to pass.
Closes #903