I have an ERC20 token contract (say at address 0x0a6ebb3690b7983e470D3aBFB86636cf64925B98) with the totalSupply() function:
function totalSupply() constant returns (uint256) {
return _totalSupply;
}
I want to call this function from another contract and assign the value of _totalSupply that is returned to a totalSupplyTest variable, eg:
uint256 public totalSupplyTest
totalSupplyTest = 0x0a6ebb3690b7983e470D3aBFB86636cf64925B98.call(bytes4(keccak256("totalSupply(uint256)")),"");
This results in the error:
Type bool is not implicitly convertible to expected type uint256
There must be something wrong in the syntax I am using - in this case how should the totalSupply() function in the external contract be called?
callonly returns a bool; how should this be done (or can it be done) to return a value of a uint256 type from another contract? – ZhouW Dec 12 '17 at 08:16