Lemonn Mobile Sticky Banner

Demat Account Registration Banner

Smart Contract

A smart contract is a self-executing program stored on a blockchain that automatically carries out the terms of an agreement when predefined conditions are met. Once deployed, smart contracts run exactly as coded without the possibility of downtime, censorship, or third-party interference.

What Is a Smart Contract?

The term “smart contract” was coined by Nick Szabo in 1994. In the blockchain context, a smart contract is code that:

1. Defines the rules of an agreement (e.g., “if X sends 1 ETH, transfer token Y to X”)
2. Is stored on the blockchain
3. Automatically executes when conditions are triggered
4. Records the outcome permanently on the blockchain

No human needs to verify or execute the transaction. The code does it automatically.

How Smart Contracts Work

Think of a smart contract like a vending machine. You insert money (trigger condition), select a product (contract terms), and the machine delivers it automatically (execution). No human shopkeeper is needed.

In a lending smart contract:
– You deposit ETH as collateral
– The contract automatically issues you a loan in USDC
– If your collateral value drops below a threshold, the contract automatically liquidates your position

Applications of Smart Contracts

– **DeFi**: lending, borrowing, trading protocols
– **NFTs**: defining ownership, royalties, and transfer rules
– **Supply chain**: automatic payment on delivery confirmation
– **Insurance**: parametric insurance that pays automatically when conditions are met (e.g., flight delayed by 3 hours)
– **Real estate**: automating property title transfers on payment

Limitations of Smart Contracts

– Code bugs: a flawed smart contract can be exploited; “code is law” means errors cannot be easily reversed
– Oracle problem: smart contracts rely on external data feeds (oracles); if the data is wrong, the contract executes incorrectly
– Immutability: once deployed, a smart contract is hard to change (though upgradeable contract patterns exist)

Practical Example

An insurance company creates a flight delay smart contract. A traveller buys a policy by sending ETH to the contract. The contract is programmed to receive flight status data from an oracle. If the flight is delayed by more than 3 hours, the contract automatically sends compensation to the traveller’s wallet. No claim filing required.

Key Takeaways

– Smart contracts are self-executing programs on blockchains that run automatically when conditions are met
– They remove the need for intermediaries in agreements
Ethereum is the most widely used smart contract platform
– Key risks include coding bugs (which can be exploited) and the oracle problem (reliance on external data)
– Smart contracts are the foundation of DeFi, NFTs, DAOs, and most Web3 applications

Sleek Sticky Registration Footer