Smart Contract Vulnerabilities and How to Avoid Them