I'm using the Mist wallet just to display the contents of the contract.
Bellow, you can see the code to access the contract function (submitUnits) and the result of the LoadScript when I run in the console.
call_function.js
In the last commented row, you can see the value I want to print (100).
However it always returns this hex number. How can i get the Total Units that is mentioned in the wallet screenshot?
The code of the contract is this:
contract UCounter {
mapping (address => uint256) public UnitsFrom;
uint256 public TotalUnits;
function submitUnits(uint256 Units) returns (uint ){
UnitsFrom[msg.sender] = Units;
TotalUnits = Units;
return TotalUnits;
}
}
Hope someone could help. Thanks.
constant
?