Crypto glossary
Smart contract
A smart contract is a program stored on a blockchain that runs automatically when predefined conditions are met, with no intermediary involved.
A smart contract is code deployed to an address on a blockchain. Once deployed, anyone can call its functions by sending a transaction, and every node in the network executes the same code and agrees on the result. Ethereum popularized the idea in 2015, and most smart contracts today are written in Solidity and run on the Ethereum Virtual Machine (EVM) or compatible chains.
Smart contracts power tokens, decentralized exchanges, lending protocols, NFTs and DAOs. They hold funds and move them according to their own rules, so users do not need to trust a company to process a trade or a loan.
The trade-off is that the code is public and often cannot be changed. A bug or a poorly protected upgrade mechanism can be exploited, and many of the largest hacks in crypto have come from smart contract vulnerabilities. Audits reduce that risk but do not eliminate it.
Example
When you swap ETH for USDC on Uniswap, a smart contract checks the pool's balances, calculates the price, takes your ETH and sends you USDC in a single transaction.
Related terms
Latest articles on Smart contract
- The Most Common Smart Contract Vulnerabilities and How Developers Can Prevent Them
- Ethereum Devs Delay Glamsterdam Hoodi Fork Over Smart Contract Risks
- TRX Rebounds as TRON Implements New Smart Contract Upgrade
- Ethereum Developers Postpone Glamsterdam Hoodi Testnet Deployment Following Smart Contract Warnings
- Aptos Labs Announces MonoMove Running Smart Contracts 55x Faster With Engine-Level Security