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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add checks to ERC7579Utils.decodeBatch #5353
Add checks to ERC7579Utils.decodeBatch #5353
Changes from 9 commits
76f6fc5
4ec7f83
b906509
c743f98
d0a6fbc
10001f1
1d7f1c3
3bc90c7
72103ba
456eb9a
63ee3ef
3363eb7
0c8e6eb
80da5b1
bcd46b5
a227e6d
6aaa56a
590e024
7a7f8ce
a8c93bd
a59a859
4622965
cc6bdc6
35c74ab
4800b82
cfcebc9
ef44c81
4d137e0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the check for the struct's static-sized elements should be performed by solidity lazily, as you access each
Execution
struct. To make this match the loose ABI-decoder exactly, I think at this stage the only necessary check would be:So, essentially just checking that the struct pointers would still fit in the available space. To illustrate, here is a non-standard, but valid, encoding of 3
Execution
s that would fail this check, but succeed inabi.decode(...)
or in the built-in ABI decoder at the top of a function:It has all 3 of the offsets point to the same location in calldata, making the total size 7 words, with is less than the expected 9 words.
Either way, it's fine if you keep it as-is, just wanted to flag that this check is ever so slightly too strict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frangio, since you looked at the encoding a bit more than I did, do you confirm that the array doesn't contain the "head" of the
Execution
but instead it contains offsets (pointers) to these heads?If that is the case, we should indeed use 32 instead of 96
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 6aaa56a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed with the ABI spec that
arrayLength * 32
is the correct value.