Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abi: cannot use []hexutil.Bytes as type [0]array as argument #30

Closed
femtoeu opened this issue Oct 17, 2022 · 1 comment
Closed

abi: cannot use []hexutil.Bytes as type [0]array as argument #30

femtoeu opened this issue Oct 17, 2022 · 1 comment

Comments

@femtoeu
Copy link

femtoeu commented Oct 17, 2022

I want to execute contract function that requires bytes32[]
I have this array in json:

"proof":["0xdac2beda9cd88c89679f4c41539e8196b29fd38407219841f936f0b6b7e8ff1a","0x22eb93710252e79914d1d4ec15716071ed5fe64b0b0c7e7e1badbce95b386442","0x7d463be3ff9f50f990b008c19834d74bf916fa71b4db3855bd54491b8b07bea7","0xb6577628cd0917349f8d6d059a5f33e8a6b2e2e8e9e95cd005ed7e0981a4a713","0x2b7733395a061fcf4c05a866e05142035f370a4a088969bb560c3761620e57e8","0x5a467b8b8aad5b144e01c349a0a3380ca8ce0829863afa03d99cff8a9b613273","0xe024adad50aa103636a4c42c0fb428c82e154bff3501d84dc5695f70cf32639d","0xc8c9fed8ed870eb1e8462d19a6e107d55c8df05528e81fa9e90af548bf985f30","0x9841222888c5a80644cf54b7d877b85efcd5789e2c2ae8388475f7871f6a1bf7","0x9a046dc08506268e16603452a33ea179b4932eeae59338dd3fee75685cc490f1","0xacba6c0ed0c90792bb6f9f696ad1417efe0032bb0e86b6927234ce419628e24c","0x0d577b40b8956166e4d21cba88b58b32dec0a00b2864e8ed4ac5d7be6683f5f2","0x97aaf35d6ca208a954554f4ab14a1ca973daf13e7c1dad49db82611f4dadf2a3","0xc32355753f5e11ba88adc0d27f10ad32ad4904bfd782c15693c6795b047124fc","0xcd0f927a7dda89206be7ad613644d02a622c3f30f5de40d052b4c3e10ef02a18","0x107e7a23a7abca2aacc0bf854e247569f822013a86927b10f772b7b13fbc8732"]

I unmarshal it into []hexutil.Bytes and when i'm passing this slice into function i get this error:

abi: cannot use []hexutil.Bytes as type [0]array as argument
@lmittmann
Copy link
Owner

You should use common.Hash for bytes32. This could use some better documentation and error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants