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
Hi,
thanks for exthereum/abi. When using it I've noticed that calls to functions with arguments of dynamic types are not properly encoded.
ABI.encode("foo(bytes)", [<<1>>]) |> Base.encode16(case: :lower)
outputs "30c8d1da00000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000"
The correct output is: "30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000"
The missing part is: 0000000000000000000000000000000000000000000000000000000000000020
which is a head part of encoded bytes and should be put right behind encoded function signature. https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#use-of-dynamic-types
The text was updated successfully, but these errors were encountered:
Hi,
thanks for exthereum/abi. When using it I've noticed that calls to functions with arguments of dynamic types are not properly encoded.
ABI.encode("foo(bytes)", [<<1>>]) |> Base.encode16(case: :lower)
outputs
"30c8d1da00000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000"
The correct output is:
"30c8d1da000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000"
The missing part is:
0000000000000000000000000000000000000000000000000000000000000020
which is a head part of encoded bytes and should be put right behind encoded function signature.
https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI#use-of-dynamic-types
The text was updated successfully, but these errors were encountered: