Labels: high-difficulty, rust, ast, gasguard
Difficulty: High
Module: gasguard-cli/src/transformers/
🧠 Concept
Develop an automated refactoring command in the GasGuard CLI that parses contract ASTs, detects un-packed storage variables, and automatically reorders variable declarations to minimize storage slot usage.
⚠️ Problem
Manually reordering state variables to optimize storage layout across large codebases is time-consuming and prone to human error.
📁 Implementation Scope
gasguard-cli/src/transformers/storage_packer.rs
gasguard-cli/test/fixtures/storage_packing_transform.sol
🛠️ Requirements
- Calculate bit sizes for state variables declared in target contract ASTs.
- Group sub-32-byte variables together sequentially to fill 256-bit slots.
- Output updated Solidity contract source code while preserving inline comments and code formatting.
🎯 Acceptance Criteria
Labels:
high-difficulty,rust,ast,gasguardDifficulty: High
Module:
gasguard-cli/src/transformers/🧠 Concept
Develop an automated refactoring command in the GasGuard CLI that parses contract ASTs, detects un-packed storage variables, and automatically reorders variable declarations to minimize storage slot usage.
Manually reordering state variables to optimize storage layout across large codebases is time-consuming and prone to human error.
📁 Implementation Scope
gasguard-cli/src/transformers/storage_packer.rsgasguard-cli/test/fixtures/storage_packing_transform.sol🛠️ Requirements
🎯 Acceptance Criteria