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
{{ message }}
This repository has been archived by the owner on May 13, 2022. It is now read-only.
Describe the Bug
I cannot successfully send address data in the form of a byte array to the ABI packing function Burrow provides. It seems to me like it might be a bug.
Burrow Version (docker image tag or branch if built from source) 0.29.7
Go Version (if applicable) 1.13.6
Docker Version (if applicable)
Operating System (osx/windows/linux) 10.14.6
Additional Context
The issue seems to me to be in the pack function in execution/evm/abi/primitives.go. The code first tries to cast interface v to a crypto.Address. If I pass the function a crypto.Address, the cast will be successful and it will take the else path after the check on line 519. At that point, it will try to cast v to a []byte. This will fail and an error will be returned on line 530.
Forgive me if I am misunderstanding things since I am somewhat new to Golang, but it seems to me like it is impossible to get to line 533 because the code is expecting v to be two different types at the same time (crypto.Address and []byte). While crypto.Address is an alias for binary.Word160 which is an alias for [20]byte, this does not make it compatible with []byte, due to the incompatibility between fixed-length and dynamic-length arrays.
The text was updated successfully, but these errors were encountered:
Describe the Bug
I cannot successfully send address data in the form of a byte array to the ABI packing function Burrow provides. It seems to me like it might be a bug.
To Reproduce
Expected Behavior
The address should be properly packed and added onto the ABI array
In the above example, the packed ABI should be
[72 151 224 99 0 0 0 0 0 0 0 0 0 0 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4]
Technical Details
Additional Context
The issue seems to me to be in the
pack
function in execution/evm/abi/primitives.go. The code first tries to cast interfacev
to acrypto.Address
. If I pass the function acrypto.Address
, the cast will be successful and it will take theelse
path after the check on line 519. At that point, it will try to castv
to a[]byte
. This will fail and an error will be returned on line 530.Forgive me if I am misunderstanding things since I am somewhat new to Golang, but it seems to me like it is impossible to get to line 533 because the code is expecting
v
to be two different types at the same time (crypto.Address
and[]byte
). Whilecrypto.Address
is an alias forbinary.Word160
which is an alias for[20]byte
, this does not make it compatible with[]byte
, due to the incompatibility between fixed-length and dynamic-length arrays.The text was updated successfully, but these errors were encountered: