Hi there,
I am currently working in a NodeJS environment and am trying to run a contract function through web3.
I am currently using version 0.2.3 i think for other dependencies reasons.
This is my code snippit:
async runfunction(abi, addr, functionToRun) {
const MyContract = new this.web3.eth.contract(abi).at(addr);
console.log('MyContract', MyContract)
const txHash = await MyContract.FunctionName('param1','param2')//.sendAsync().get();
// TRIED THIS : const txHash = await MyContract.FunctionName().sendAsync().get();
// ALSO THIS const tx = await MyContract.FunctionName('new string').call().then(function (id) { console.log(id) })
console.log(txHash);
}
When I run this however i get the following issue:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property ‘sendAsync’ of undefined
TypeError: Cannot read property ‘sendAsync’ of undefined
When I console.log MyContract i get the following :
Any help would be greatly appriciated.
Thanks
Chadizzle