I am trying to follow this flow to access a contract that has been mined previously:
var MyContract = new web3.eth.Contract(abiJSON); // instantiate by address var contractInstance = MyContract.at(address);
Unfortunatly the contractInstance does not work and I get a contract.at is not a function error. I suspect it has something to do with web3js newest version but I am not sure what to use instead.
I have just tried:
var deployed = new web3.eth.Contract(jsonAbi, address)
But then when I try to call my public function on the contract I get an error:
TypeError: Cannot read property 'call' of undefined
If I look into
deployed every thing from the abi to the address is there, so it seems like the fetching of the contract actually worked.