Skip to content

[RULE] Rule G003: Flag Public Variables in Internal/Abstract Contracts #650

Description

@mijinummi

Labels: good-first-issue, gasguard-rules, solidity, gasguard
Difficulty: Easy
Module: rules/g003_abstract_visibility.rs


🧠 Concept

Add static rule G003 to flag state variables defined as public within abstract or internal base contracts.

⚠️ Problem

public state variables in abstract contracts auto-generate public getters in every inheriting child contract, swelling deployment bytecode size unnecessarily.

📁 Implementation Scope

  • rules/g003_abstract_visibility.rs
  • test/fixtures/g003_samples.sol

🛠️ Requirements

  1. Detect variable declarations with public visibility inside abstract contract blocks.
  2. Suggest changing visibility to internal or private.

🎯 Acceptance Criteria

  • Flags public state variables in abstract classes.
  • Passes without warnings on internal or private declarations.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions