I get this error when I try to call my solidity function using truffle.
My solidity code is as :
pragma solidity ^0.4.14;
contract SimpleDemo {
function returnNumber () public view returns (uint) {
return 500;
}
}
The way I'm calling returnNumber()
is by :
this.state.web3.eth.getAccounts((error, accounts) => {
simpleDemo.deployed().then((instance) => {
simpleDemoInstance = instance
// Below line runs with the error ...
return simpleDemoInstance.returnNumber.call()
}).then((result) => {
console.log(result)
})
})
Also, this solution did not help at all. Hence, I asked separately.