In Solidity, I have an array declared as follows:
uint[] public moveTimeStamp;
In web3 JavaScript I would like to retrieve the element at position 0 in the array. I tried to access it like this:
var contract = web3.eth.contract(interface);
var instance = contract.at("0x1234...");
instance.moveTimeStamp(0).call(function(err, result) {....
Web3js says this isn't correct. What should I be writing after moveTimeStamp
?
I tried the following:
instance.moveTimeStamp(0)
instance.moveTimeStamp([0])
...which doesn't work.
This is how I call it:
var contract = web3.eth.contract(interface);
var instance = contract.at(contractaddress);
instance.callTimeStamp(0).call(function(err, result) {...
And this is the error I get
TypeError: instance.callTimeStamp(...).call is not a function
And if you will like see that the callTimeStamp
array really does contain something, you can go to https://ropsten.etherscan.io/address/0x86c9d3abf13d25ced87c0d00331667ac44c04a89#readContract to read the contract variables.