Skip to content

Implement Soroban Best Practices Rule Pack#554

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
Habibah371:Implement-Soroban-Best-Practices-Rule-Pack
Jun 26, 2026
Merged

Implement Soroban Best Practices Rule Pack#554
mijinummi merged 1 commit into
MDTechLabs:mainfrom
Habibah371:Implement-Soroban-Best-Practices-Rule-Pack

Conversation

@Habibah371

Copy link
Copy Markdown
Contributor

Soroban Best Practices Rule Pack

The Soroban Best Practices Rule Pack extends GasGuard beyond vulnerability detection by providing actionable recommendations for writing secure, maintainable, and efficient Soroban smart contracts. Instead of identifying only exploitable security issues, this rule pack helps developers adopt coding patterns that align with the Stellar ecosystem's recommended practices.

Overview

Located in:

src/rules/best-practices/stellar/

This rule pack analyzes Soroban contracts for common best-practice violations and generates findings that improve code quality, readability, maintainability, and long-term reliability.

Features

  • ✅ Detects deviations from Soroban development best practices
  • ✅ Categorizes findings by type and severity
  • ✅ Supports configurable rule sets
  • ✅ Generates clear, actionable recommendations
  • ✅ Complements GasGuard's security vulnerability scans

Rule Categories

The rule pack can include checks such as:

  • Code organization and readability
  • Storage access best practices
  • Authorization and access control recommendations
  • Error handling and panic avoidance
  • Event emission consistency
  • Resource optimization and efficient storage usage
  • Maintainability and developer experience improvements
  • General Soroban development guidelines

Configuration

Rules can be enabled, disabled, or customized to match a project's coding standards and security requirements.

Example:

best-practices:
  enabled: true
  rules:
    storage-efficiency: warning
    authorization-patterns: error
    event-consistency: warning
    panic-usage: info

Example Finding

Rule: storage-efficiency
Severity: Warning

Repeated storage lookups detected within the same execution path.

Recommendation:
Cache the storage value locally to reduce unnecessary storage access and improve contract performance.

Benefits

  • Encourages consistent Soroban development practices
  • Improves contract quality before deployment
  • Reduces technical debt and maintenance costs
  • Helps developers write cleaner, more efficient smart contracts
  • Works alongside security rules to provide comprehensive contract analysis

Acceptance Criteria

Implement Soroban Best Practices Rule Pack
@mijinummi mijinummi merged commit 428d7ea into MDTechLabs:main Jun 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Soroban Best Practices Rule Pack

2 participants