Skip to content

Add G023 rule to flag unused capacity allocations in memory arrays - #746

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
Spaully:fix/issue-740-g023-memory-array
Jul 29, 2026
Merged

Add G023 rule to flag unused capacity allocations in memory arrays#746
mijinummi merged 1 commit into
MDTechLabs:mainfrom
Spaully:fix/issue-740-g023-memory-array

Conversation

@Spaully

@Spaully Spaully commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Added static rule G023 to detect memory array declarations initialized with large fixed sizes that are not fully populated, flagging unnecessary memory expansion gas costs.

Changes

  • Created rules/g023_memory_array_allocation.rs with AST pattern detection
  • Detects new uintX[](size) declarations without matching population loops
  • Created test/fixtures/g023_samples.sol with positive and negative samples

Closes #740
Closes #743
Closes #742
Closes #741

Detects memory array allocations with fixed sizes where no
population loop is present, flagging wasted memory expansion gas.

Closes MDTechLabs#740
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Spaully 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! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit e3d1a73 into MDTechLabs:main Jul 29, 2026
1 of 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

2 participants