Skip to content
Wallets & Security

What Is a Smart Contract? Definition & Example

Self-executing code deployed on a blockchain that enforces an agreement automatically without an intermediary.

A smart contract is a program deployed to a blockchain that executes automatically when its conditions are met. It holds funds, enforces rules, and runs without anyone able to intervene — which is simultaneously its greatest strength and the source of most large crypto losses.

Every part of DeFi is built from them: exchanges, lending markets, stablecoins, staking, liquidity pools. When you deposit into a protocol, you are transferring funds to a contract and trusting that its code does what you believe it does.

That trust is not social, it is technical. Contracts are typically immutable once deployed — the code cannot be patched if a bug is found. There is no support line, no reversal, no insurance. Billions of dollars have been lost to exploits in contracts that were audited, deployed by reputable teams, and functioning exactly as written but not as intended.

Practical defences, in rough order of value: prefer protocols that have held significant value for a long time without incident, since time in production is the strongest available evidence. Check for multiple independent audits, while remembering that audited contracts still get drained. Avoid granting unlimited token approvals and revoke old ones periodically — a stale approval to a compromised contract is a common way wallets get emptied long after the interaction.

And size positions with contract risk explicitly in mind. Every DeFi position carries a small, non-zero probability of total loss that has nothing to do with your market view, so the amount in any single protocol should be an amount you could lose without it mattering.

Share Post

← Back to the full crypto & trading glossary, or browse all 53 learn articles.