Blockchain · Question 5 of 6

What are smart contracts?

A smart contract is a program stored on a blockchain that runs automatically when its conditions are met, without a middleman. It's how many apps and tokens operate.

How they work

A smart contract holds rules as code. When you interact with it — say, swapping tokens — it executes those rules exactly and records the result on the blockchain.

Approvals

Using a contract often means granting it permission (an approval) to handle a certain token from your wallet. Broad or unlimited approvals are worth reviewing, since they can be abused.

Why it matters

Smart contracts power most of what people call DeFi and dApps — and approvals are a common attack surface, so understanding them protects you.

A practical way to picture it

Think of a vending machine: put in the right input, and it automatically gives the defined output, with no clerk involved. A smart contract is that logic, on a blockchain.

Risks & common mistakes
  • Bugs or malicious code in a contract can cause loss.
  • Overly broad approvals can let a contract drain tokens — review and revoke when unsure.
  • 'Audited' does not guarantee safety.
Put it into practice

See the ecosystem map

Open ›

Related questions

Last reviewed 2026-06-25. This topic can change over time; always confirm current specifics from primary sources.