Working on the remix IDE, i cant seem to pass an array of addresses along with an array of uint as parameter to a function. It runs just fine on ethfiddle though and behaves exactly how i expected it to.
It keeps saying on remix, syntax error unexpected token at JSON position 3.
How do I call and test the function set with an array of address and array of value.
here's the code snippet and I am using solidity version 0.5.1 :
contract SimpleStore {
uint public value;
address public addr;
function set(address[] _addr , uint[] _value) public {
value = _value[0];
addr = _addr[0];
}
function get() public constant returns (uint) {
return value;
}
}
I have tried, with quotes without quotes with square brackets without square bracks 🙁 -thanks in advance.
Best Answer
After updating the code to work with Solidity 0.5.x, the following input for
set
worked fine for me:After calling
set
, I checked the values ofaddr
andvalue
to and got0x12345...
and1
, respectively.For reference, here's the updated code I used with 0.5.2: