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


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! – porfavorite Jul 11 '17 at 20:04
  • @porfavorite if the answer above resolved your problem, please mark it as accepted. – Badr Bellaj Jul 12 '17 at 0:18
  • of course, as soon as I test in web3, didn't test yet – porfavorite Jul 12 '17 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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