A smart contract is a self-executing contract in which the conditions of the buyer-seller agreement are put directly into lines of code. They perform specific functions when certain conditions are met. In the crypto sphere, smart contracts are used to facilitate transactions between parties that can only be done if certain pre-determined conditions are met.
The code and agreements it contains are disseminated across a decentralized blockchain network. Blockchain-based smart contracts make transactions traceable, transparent, and irreversible.
Smart contracts eliminate the need for a central authority, legal system, or external enforcement mechanism to carry out trustworthy transactions and agreements between distant, anonymous participants. They are trust-less and cost-effective solutions to exchanging funds during Initial Coin Offering as in the case of ERC-20.