Labels: medium-difficulty, gasguard-rules, static-analysis, gasguard
Difficulty: Medium
Module: rules/g009_redundant_sstore.rs
🧠 Concept
Develop rule G009 to detect multiple writes (SSTORE) to the same storage variable within a single execution path before final state settlement.
⚠️ Problem
Updating a state variable multiple times within a single function call burns unnecessary gas when only the final state update needs to be persisted.
📁 Implementation Scope
rules/g009_redundant_sstore.rs
test/fixtures/g009_samples.sol
🛠️ Requirements
- Analyze control flow graphs to track state variable assignments.
- Flag cases where a variable is written, overridden, or updated multiple times prior to function exit without intermediate external reads.
🎯 Acceptance Criteria
Labels:
medium-difficulty,gasguard-rules,static-analysis,gasguardDifficulty: Medium
Module:
rules/g009_redundant_sstore.rs🧠 Concept
Develop rule
G009to detect multiple writes (SSTORE) to the same storage variable within a single execution path before final state settlement.Updating a state variable multiple times within a single function call burns unnecessary gas when only the final state update needs to be persisted.
📁 Implementation Scope
rules/g009_redundant_sstore.rstest/fixtures/g009_samples.sol🛠️ Requirements
🎯 Acceptance Criteria
SSTORE.