3 ms·
Solidity contracts can define "const" functions which aren't allowed to change state. For some uses you can also look at the events that a contract emits, whic
by mbrock 10y ago
Solidity contracts can define "const" functions which aren't allowed to change state.
For some uses you can also look at the events that a contract emits, which are indexed and searchable off-chain... so client apps can read them, but not contracts themselves.
- rwallace 10y agoOkay, so const was available as a feature - but not used because it wasn't the default? Some of the discussion on this seems to be saying Solidity supports exceptions and transactions, which should provide a lot of safety here (on error, an exception should be thrown and everything the script just did should be rewound) but the documentation was still exhorting programmers to check return values all over the place. Is this at least in part a matter of bad defaults? I'd be quite prepared to believe so; bad defaults are a much bigger problem than they are sometimes thought to be.