I am learning smart contract programming on Ethereum (using Solidity) and realizing that security is highly important here. Why? Because of 2 reasons: they deal with high-stake financial transactions, and smart contracts are immutable once you deploy them. Hence, you have to be really sure about the safety of your code before deploying it. To ascertain this, several static analysis tools are being built and many researchers are actively publishing papers regarding their security.
Now, the security of a smart contract ultimately boils down to safeguarding the internal private variables being changed by a "non-owner" (of the contract). There are several variables and functions, a few public entry-points into the smart contract, and you have to ensure that no entry point leads to malicious consequences.
However, this kind of safeguarding sounds eerily familiar. Isn't that what we have been doing when designing web APIs or classes or RPCs or just any kind of architecture where calls from outside are being made to our internal code base? What exactly sets smart contracts apart in terms of security?