etherwallet
etherwallet copied to clipboard
Error calling contract with address[] parameter
My contract can get array of "address" values as method parameter. But when I try to execute that method from MyEtherWallet (by pressing Write button), it fails with console errors.
Of course is "not a number" it's an address.
At the web interface this method displayed correctly:

I believe the issue here isn't that it's not a number, but that it is an array, not a single address. Unfortunately, I personally have no idea how to address this.
Can you please send the contract ABI / address so I may talk with the team and debug? Thank you!
I'm facing same problem.
Hi, same problem here, but I think I know what is wrong.
Try formatting input like this:
0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8,0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8
ommit [ and ".
The reason is MEW is not validating this input properly, beacause it is not treating address arrays address[] as addresses. You can type anything in the field and it becomes "green".
Your example didn't go through at least, but one can type something like this:
0x7cB57B5A97eAbe94,0x7cB57B5A97eAbe94205C0,0x7cB57B5A97eAb (too short addresses)
and transaction could still be created for some contracts functions. '0's would be padded on the left for those array elements(addresses). This might lead to broadcasting badly formatted transactions(wasting gas).
I'm am not 100% that is the case, so please be carefull and test it first.
Same here by using uint256[]
Can confirm, just ran into this. @johnerfx's solution worked. UI should be updated to reflect this, but not sure of BC breaks it might cause. Will study and possibly submit PR.
I will look into this as well
To add to this, I need to pass a null address and an empty array. It doesn't look like this is possible currently.
The suggestion above doesn't seem to be working atm. Neither are any other options like wrapping each address in " or []
