Smart contracts can be public, which opens up the possibility to prove functionality, e.g. self-contained provably fair casinos.
One issue related to using smart contracts on a public blockchain is that bugs, including security holes, are visible to all but cannot be fixed quickly. One example of this is the 2016 attack on The DAO, which could not be quickly stopped or reversed.
There is ongoing research on how to use formal verification to express and prove non-trivial properties. A Microsoft Research report noted that writing solid smart contracts can be extremely difficult in practice, using The DAO hack to illustrate this problem. The report discussed tools that Microsoft had developed for verifying contracts, and noted that a large-scale analysis of published contracts is likely to uncover widespread vulnerabilities. The report also stated that it is possible to verify the equivalence of a Solidity program and the EVM code.
Read more: https://en.wikipedia.org/wiki/Ethereum