Smart contracts are self-executing contracts with the terms of the agreement directly written into code. They are designed to automatically enforce and execute the terms of a contract without the need for intermediaries. This paper provides a comprehensive review of smart contracts, focusing on their design, implementation, and applications in blockchain-based systems. We discuss the underlying principles of smart contracts, their technical implementation, and various use cases across different industries. Additionally, we explore the challenges and future directions of smart contract technology.