This is my contract-
pragma solidity ^0.4.0;
contract helloworld {
uint public balance;
function helloworld(){
balance = 1000;
}
function getBalance() returns(uint) {
return balance;
}
}
I ran truffle compile and truffle migrate. Then I'm trying to access the balance variable by
helloworld.deployed().balance.call();
I'm getting the following error-
TypeError: Cannot read property 'call' of undefined
at evalmachine.<anonymous>:1:30
at ContextifyScript.Script.runInContext (vm.js:35:29)
at Object.runInContext (vm.js:89:6)
at TruffleInterpreter.interpret (C:\Users\ujjwa\AppData\Roaming\npm\node_modules\truffle\lib\repl.js:136:17)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:538:10)
at emitOne (events.js:96:13)
at REPLServer.emit (events.js:188:7)
at REPLServer.Interface._onLine (readline.js:230:10)