Smart Contract
- A smart contract is a program stored on a blockchain that executes automatically when its predefined conditions are met, with the outcome enforced by the network rather than a bank, broker or court.
- Once deployed to a platform such as Ethereum, anyone can call its functions, and every node runs the same code to reach the same result so it cannot be quietly changed.
- Smart contracts are the building blocks of DeFi, NFTs and DAOs, but their public code means bugs are exploitable and a flaw can be drained before it is fixed.
A smart contract is a program stored on a blockchain that executes automatically when its predefined conditions are met. Because the code and its results live on the chain, the outcome is enforced by the network rather than by a bank, broker or court.
How it works
A developer writes the contract’s logic — for example, “release these funds when both parties have deposited” — and deploys it to a smart-contract platform such as Ethereum. Once deployed, anyone can call its functions. Every node runs the same code and must reach the same result, so the contract behaves identically for everyone and cannot be quietly changed.
Why it matters
Smart contracts are the building blocks of decentralized finance, NFTs and DAOs. They remove the need to trust a middleman, but they also mean that bugs are public and exploitable: a flaw in the code can be drained by anyone before it is fixed, which is why audits matter.
Example
A decentralized exchange is a set of smart contracts that swap one token for another and pay liquidity providers automatically, with no company holding the funds.
What makes a smart contract "smart"?
Can a smart contract be changed after it is deployed?
Are smart contracts risky?
Other glossary terms connected to this one.
Go deeper than the definition — explainers, live data and free calculators.