There has been a rise in the demand for blockchain-based smart contract development platforms and language implementations. On the other hand, smart contracts and blockchain applications are generated using non-standard software life cycles, which means that, for example, distributed applications are rarely updated, or bugs are fully addressed by releasing a newer version, leading to security flaws and challenges for users to adopt the technology. Smart contracts have gained significant attention due to their potential to automate and secure various transactions in diverse domains. However, the increasing adoption of smart contracts has also raised concerns about security vulnerabilities and potential risks. In this paper, an overview of smart contracts was discussed in detail. It further distinguished and compared smart contracts security with conventional security regarding security, privacy, communication channel, etc. Different platforms for smart contracts, such as Bitcoin, Ethereum, Counterparty, Stellar, Monax, and Lisk, are also discussed in this paper. Some proposed techniques are used in different areas for handling security threats in smart contracts. In addition, a taxonomy of the smart contracts security application was proposed, which attempts to solve some of the flaws and inadequacies in smart contracts. The study also provides a comprehensive smart contracts security scenario with different techniques. Lastly, the possible attacks posed by threats and vulnerabilities of the smart contracts are provided. The security threats and vulnerabilities addressed in this study are unique to smart contracts.