Can you declare a constant variable in Solidity?
const uint answer = 42;
Or is the only way to do it with a const function?
function GetAnswer() constant returns(uint ret) {
return 42;
}
I know you could always create a normal public variable and then just not have any setters in the code, but this is not immediate obvious from the declaration, so it seems preferable to explicitly declare a variable as a constant or read-only if the language supports it.
uint
here? – Joris Bontje Jul 8 '16 at 6:38