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
I have been running into a case where if I use ExW3 with a solidity smart contract that needs a bytes function argument it will fail. I think this might be related to how the encoding works within ExW3, however when I bypass ExW3 and use ABI directly it works:
ABI.encode("setTest(bytes)", [encoded_data])
From what I can tell, there seems to be an extra 64 bytes of data being included in the ExW3 version that I am not sure where it is coming from.
Example:
# Fails when submitted as part of the transaction# the variable `abi` was parsed from the contract abi file using ExW3ExW3.Abi.encode_method_call(abi,"setTest",[<<1,2,3,4>>])"0af724830000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040102030400000000000000000000000000000000000000000000000000000000"# Works when submitted as part of the transactionABI.encode("setTest(bytes)",[<<1,2,3,4>>])|>Base.encode16(case: :lower)"0af72483000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000040102030400000000000000000000000000000000000000000000000000000000"
Looking at the output it seems to be include a second "0x2" block of 64 bytes so I think something is getting wrapped twice.
The text was updated successfully, but these errors were encountered:
cjimison
changed the title
Calling function that takes requires bytes fails
Calling function that requires bytes argument fails
Aug 11, 2022
I have been running into a case where if I use ExW3 with a solidity smart contract that needs a
bytes
function argument it will fail. I think this might be related to how the encoding works within ExW3, however when I bypass ExW3 and use ABI directly it works:ABI.encode("setTest(bytes)", [encoded_data])
From what I can tell, there seems to be an extra 64 bytes of data being included in the ExW3 version that I am not sure where it is coming from.
Example:
Looking at the output it seems to be include a second "0x2" block of 64 bytes so I think something is getting wrapped twice.
The text was updated successfully, but these errors were encountered: