For example:

address[] storage;
function addAddress(address _a)

I need somehow to call it from the web3. When I'm trying to simply send some address 0x1234... to the function in Remix I'm getting an error:

Error encoding arguments: SyntaxError: Unexpected token x in JSON at position 2

1 Answer 1


Have you tried to add quotation marks? Try to insert "0x123..."

  • Dude, you are genius! Worked for the Remix, will work for the web3 as well I guess. thank you! Jul 11, 2017 at 20:04
  • @porfavorite if the answer above resolved your problem, please mark it as accepted.
    – Badr Bellaj
    Jul 12, 2017 at 0:18
  • of course, as soon as I test in web3, didn't test yet Jul 12, 2017 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.