I have a problem when executing the code
HelloWorld.deployed().balance.call().then(console.log)
This error introduced: Cannot read property 'call' of undefined This problem is similar to this thread but it does not help on my case.
My code is from this turorial
contract HelloWorld {
address public owner;
mapping (address => uint) balances;
function HelloWorld() {
owner = msg.sender;
balances[owner] = 1000;
}
function transfer(address _to, uint _value) returns (bool success) {
if (balances[msg.sender] < _value) {
return false;
}
balances[msg.sender] -= _value;
balances[_to] += _value;
return true;
}
function getBalance(address _user) constant returns(uint _balance) {
return balances[_user];
}
}