-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix encodePacked DynamicBytes #2042
Conversation
Signed-off-by: gtebrean <[email protected]>
Signed-off-by: gtebrean <[email protected]>
Signed-off-by: gtebrean <[email protected]>
Signed-off-by: gtebrean <[email protected]>
Signed-off-by: gtebrean <[email protected]>
Signed-off-by: Nischal Sharma <[email protected]>
Signed-off-by: Nischal Sharma <[email protected]>
Signed-off-by: Nischal Sharma <[email protected]>
Signed-off-by: Nischal Sharma <[email protected]>
Signed-off-by: hamburger <[email protected]>
@xutruth Thanks for contributing. Can you plz add a changelog entry for this? |
Signed-off-by: hamburger <[email protected]>
@xutruth Hey, Can you add link to the references for examples or tests you added of encodePacked DynamicBytes. |
Signed-off-by: hamburger <[email protected]>
I also refer to the official solidity documentation,v0.8.25, There are two sentences on how to encode strings and bytes
but if use abi.encodePacked(struct) will be Error (9578): Type not supported in packed mode. So I modified the handling of Utf8String and DynamicBytes,plz refer to this submission b1ad81b6 ,I added a comment “removePadding can also be used, but is not necessary“ |
|
|
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.
LGTM
What does this PR do?
fix encodePacked DynamicBytes
In solidity, abi.encodePacked function is used to pack the given parameters into a tightly packed byte array without inserting length information. This function is commonly used for creating hashes or signatures of data in Solidity contracts, It does not align the data to 32 bytes like abi.encode.
Where should the reviewer start?
Why is it needed?
fix encodePacked DynamicBytes -> solidity bytes
Checklist