fix: support fixed-size array dimensions in signature parser#277
Closed
Maroutis wants to merge 1 commit intoLedgerHQ:mainfrom
Closed
fix: support fixed-size array dimensions in signature parser#277Maroutis wants to merge 1 commit intoLedgerHQ:mainfrom
Maroutis wants to merge 1 commit intoLedgerHQ:mainfrom
Conversation
The Lark grammar only handled dynamic arrays (`[]`) but rejected fixed-size arrays (`[N]`), causing lint failures on valid Solidity types like `address[11]` and `uint256[5][5]`. Made-with: Cursor
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 Lark grammar in the ABI signature parser only handled dynamic arrays (
[]) but rejected fixed-size arrays ([N]), causingInvalid signatureerrors when linting valid Solidity/ABI types such asaddress[11],uint256[5][5], oraddress[5].Changes (3 lines in
src/erc7730/common/abi.py):array: "[]"→array: "[]" | "[" /[0-9]+/ "]"to accept both[]and[N]arraytransformer: preserve the size dimension instead of always returning"[]"named_tuplefilter: match array suffixes bystartswith("[")instead of== "[]"so fixed-size arrays on tuples are correctly identifiedTest plan
uint256[3]), multi-dimensional fixed-size (uint256[5][5],uint256[2][3][4]), mixed fixed/dynamic (bytes32[2][]), and fixed-size tuple arrays ((uint256,address)[3])Made with Cursor