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
'646176696420617474656e626f726f756768'# encoding of b'david attenborough'
'00'# encoding for `False`
'626f617479206d63626f617466616365'# encoding of b'boaty mcboatface'
'01'# encoding for `True`
),
However my cursory reading of solc output says that they are in fact padded. (solidity disallows structs in abi.encodePacked, but it uses the packed encoding code path to calculate event indexes). event.ir.txt event.sol.txt
The text was updated successfully, but these errors were encountered:
Thanks for the report @charles-cooper. On first glance, this does look like a bug. It will probably be a few weeks before I can get to really digging in though. If you want to open a PR, that will be the fastest way to get it fixed, otherwise I can take a deeper look in a few weeks.
I'm wondering if it's worth fixing. ethereum/solidity#11593 says encodePacked is going to be removed, it's unclear to me what the effect will be on event indexes though.
For arrays, encodePacked appears to fall back to standard encoding.
eth-abi/eth_abi/encoding.py
Line 666 in decaadc
->
eth-abi/eth_abi/encoding.py
Lines 615 to 631 in decaadc
However, solidity skips the length and pads dynamic array elements with zeros:
https://docs.soliditylang.org/en/v0.8.6/abi-spec.html#non-standard-packed-mode
cf. ethereum/solidity#8441 for an example of the current padding scheme.
Additionally, and please correct me if I'm wrong here, eth-abi appears to encode bytestrings in tuples without padding as in the tests here
eth-abi/tests/common/unit.py
Lines 166 to 171 in decaadc
However my cursory reading of solc output says that they are in fact padded. (solidity disallows structs in abi.encodePacked, but it uses the packed encoding code path to calculate event indexes).
event.ir.txt
event.sol.txt
The text was updated successfully, but these errors were encountered: