fix: naming-convention false positive on ERC-7201 $ storage pointer - #3080
Open
innbuld wants to merge 1 commit into
Open
fix: naming-convention false positive on ERC-7201 $ storage pointer#3080innbuld wants to merge 1 commit into
innbuld wants to merge 1 commit into
Conversation
`$` is a valid Solidity identifier and the de-facto convention for the ERC-7201 namespaced-storage struct pointer (OpenZeppelin upgradeable, Solady, and others). It has no letters to case, so the mixedCase checks should treat it as conformant. Before this change, every `function f(SomeStorage storage $)` reported a `Parameter ... .$ is not in mixedCase` false positive (24+ on Solady alone). This exempts the exact identifier `$` in `is_mixed_case` and `is_mixed_case_with_underscore`, matching the existing pragmatic exceptions (ERC20 lowercase names, leading `_`, `i_`/`s_`). Adds a regression test with a tripwire confirming that genuine Solidity-level naming violations are still reported.
innbuld
force-pushed
the
fix/naming-convention-erc7201-dollar
branch
from
August 13, 2026 09:17
7d85e1c to
5f52586
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
naming-conventiondetector reports the identifier$asis not in mixedCase.$is a valid Solidity identifier and the de-facto convention for the ERC-7201 namespaced-storage struct pointer (OpenZeppelin upgradeable, Solady, and most modern contracts). It has no letters to case, so it should be treated as conformant, consistent with the detector's other pragmatic exceptions (ERC20 lowercase names, leading_,i_/s_).Impact
Any project using ERC-7201 namespaced storage gets one false positive per
function f(SomeStorage storage $). Solady alone emits 24+Parameter ... .$ is not in mixedCasefindings, drowning out real results.Minimal repro:
Fix
Exempt the exact identifier
$inis_mixed_caseandis_mixed_case_with_underscore. The exemption is intentionally limited to the lone$(the demonstrated convention) and does not broaden to arbitrary$-containing names, so no genuine violations are silenced.Testing
naming_convention_dollar_storage.sol, covering$as a read parameter,$as an unused parameter, and a snake_cased tripwire parameter that must still be flagged. The snapshot contains exactly the tripwire finding.ruff check/ruff formatclean.