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

INVALID_ARGUMENT error for array argument when trying to use Write Contract feature #3486

Closed
varasev opened this issue Nov 26, 2020 · 6 comments · Fixed by #3531
Closed

INVALID_ARGUMENT error for array argument when trying to use Write Contract feature #3486

varasev opened this issue Nov 26, 2020 · 6 comments · Fixed by #3531
Assignees
Labels
contract interaction waiting on feedback Waiting for original opener to respond if bug is fixed

Comments

@varasev
Copy link
Contributor

varasev commented Nov 26, 2020

I'm getting an error expected array value (argument="_whitelist", value="[\"0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D\"]", code=INVALID_ARGUMENT, version=abi/5.0.0-beta.153) when clicking the Write button for the setSendersWhitelist function on the page https://blockscout.com/poa/xdai/address/0x5f849Fee27a1029fA5bDFA610677f95a82B47Eb8/write-contract

The input value is ["0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D"].

I also tried without quotes [0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D] and without brackets 0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D.

@vbaranov
Copy link
Member

@varasev it should be fixed now. Could you check at your side? You don't need to wrap in quotes or brackets

@vbaranov vbaranov added the waiting on feedback Waiting for original opener to respond if bug is fixed label Nov 30, 2020
@varasev
Copy link
Contributor Author

varasev commented Dec 1, 2020

@vbaranov I still see the error when I try to pass an array of addresses there. Tried these cases:

  • 0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe
  • [0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe]
  • "0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D","0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe"
  • ["0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D","0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe"]

@vbaranov
Copy link
Member

vbaranov commented Dec 1, 2020

@varasev yes, sorry. xDai instance patched with the final fix. Could you check again?

@varasev
Copy link
Contributor Author

varasev commented Dec 1, 2020

Now it works fine except a case when we don't use [, ] and quotes. I.e. it is fine for

  • 0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D
  • 0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe

But the error persists for

  • "0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D"
  • [0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D]
  • [0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe]
  • "0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D","0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe"
  • ["0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D","0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe"]

I think we should make a text note to let users know which format is correct in case of address[] parameter because its behaviour differs from remix'es

@vbaranov
Copy link
Member

vbaranov commented Dec 7, 2020

I added support of square brackets for array input type. Thus, these inputs are correct:

  • 0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe
  • [0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe]

@varasev
Copy link
Contributor Author

varasev commented Dec 8, 2020

Could you also add support of quotes? Remix accepts the array as JSON input and it doesn't accept

[0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D,0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe]

but accepts

["0xb408e8217Aa6Bb2fEaD09FFCBAa505255573e04D","0x1092a1E3A3F2FB2024830Dd12064a4B33fF8EbAe"]

The users who used JSON or Remix would expect that the correct JSON formatted array should work on Blockscout as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract interaction waiting on feedback Waiting for original opener to respond if bug is fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants