The ERC20 token standard specifies balanceof()
with a constant
:
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
But the function doesn't change the state of anything anyway. So what is the sense of constant here?
Functions marked with the constant modifier do 2 things.
Specifying this in the ERC20 standard just ensures you're following those rules. A client using the token should not have to unexpectedly pay for gas consumed just to get balance information.