The following is my code in solidity
pragma solidity ^0.4.2;
contract DappToken {
//Constructor
// set no of Tokens
// Read the total number of Tokens
uint256 public totalSupply;
function DappToken () public {
totalSupply = 10000000;
}
}
Now i am going to interact with Truffle 1) I have done Truffle migrate
2) In Truffle console i used DappToken.deployed().then(function(i) {token = i ;})
3)deployed() returns a promise and then takes a call back (correct me if I am wrong )
4) Next i used
token.totalSupply
{ [Function]
call: [Function],
sendTransaction: [Function],
request: [Function: bound ],
estimateGas: [Function] }
// It is showing the following output
totalSupply is the name of the variable which i have given but it is showing Function in square brackets can any one explain how truffle is compiling inside and why it is showing me as Function I tried token.DappToken.totalSupply it is showing me error I thought it will go inside the contract and call the variable