by Animats · 9y ago · 0 comments
As I've pointed out before, smart contracts need atomic transactions. Either everything commits, or nothing commits. This is a basic property needed for accounting systems.
There's one well-known exception, which is that if your contract sends ETH to another contract, invoking its fallback function, then a throw in the callee just means the call returns false. So in that particular case you have to check the return value and rethrow to make it atomic; this sounds crazy but in some circumstances you don't actually want to throw. The compiler gives you a warning if you don't check.
(insert "should i use a blockchain" infographic, which is amusingly impossible to google image search for, because this question evidently does not often occur to people...)
"get used to blockchain when all you know is SQL" - cool.
"guarantee all us non-trusted nodes have the same SQL database" - ...sure, but for any project such that i want this, i'm pretty sure i don't need a blockchain. (but of course, your project doubtless has uses i haven't thought of)
"i want a trustless SQL database so i'm going to use EVM and solidity and put it on The Blockchain because i'm awesome" - very bad.
"i'm starting a new project, so naturally i need to use a blockchain" - extremely bad.