You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables of type bytes and string are special arrays. The bytes type is similar to bytes1[], but it is packed tightly in calldata and memory. string is equal to bytes but does not allow length or index access.
This results in a scheme where some things are packed tightly and others aren't.
Is there a way to use this library to easily match the semantics of abi.encodeWithSignature?
Specifically I am looking for a way to do the following:
Here the empty bytes are getting encoded as 0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
but I'd like it to be 0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000
essentially, there should be 32 fewer bytes
The text was updated successfully, but these errors were encountered:
In solidity calldata has special conventions for encoding. See: https://docs.soliditylang.org/en/v0.8.14/types.html#arrays
This results in a scheme where some things are packed tightly and others aren't.
Is there a way to use this library to easily match the semantics of
abi.encodeWithSignature
?Specifically I am looking for a way to do the following:
Here the empty bytes are getting encoded as
0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
but I'd like it to be
0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000
essentially, there should be 32 fewer bytes
The text was updated successfully, but these errors were encountered: