Ethereum and smart contracts are very new and highly experimental. Since smart contract engineering is different from traditional applications, it has to be done with care and precision. The cost of failure can be very high with smart contracts.
A deployed smart contract cannot be modified at a later stage. This brings increased trust and transparency, but the same applies to any bugs found after deployment. Before deploying the contract, it is important to ensure that no bugs are present in the contract and that a fail-safe mechanism to safeguard the funds is included.
This chapter covers known bugs that can occur while writing a smart contract and ways to avoid them.