Skip to main content
DFR Publication
Donate
← DeFi glossary

Glossary · S

Smart Contract

Key takeaway

Self-executing code stored on a blockchain that automatically carries out the terms of an agreement when predefined conditions are met. Smart contracts are the foundation of DeFi — they automate lending, trading, yield generation, and governance without human intermediaries. Once deployed, smart contract code cannot be altered (unless the contract has explicit upgrade mechanisms).

Last updated

How Smart Contract works in practice

A smart contract is code deployed to a blockchain that executes exactly as written when called. There is no discretion and no interpretation, which is what makes it trustworthy and also what makes bugs unrecoverable.

Worked example

A lending contract accepts a deposit, credits a balance, and allows a withdrawal of that balance plus interest. Nobody approves any of it; the code runs identically for everyone who calls it.

Figures are illustrative and chosen to be checkable, not live market data.

The mistake that costs people money

'The code is law' cuts both ways. A contract with a bug executes the bug faithfully, and funds taken through it were taken by the rules as written. Immutability means no undo — audits and timelocks exist precisely because of this.

Smart Contract: common questions

What is Smart Contract?
Self-executing code stored on a blockchain that automatically carries out the terms of an agreement when predefined conditions are met. Smart contracts are the foundation of DeFi — they automate lending, trading, yield generation, and governance without human intermediaries. Once deployed, smart contract code cannot be altered (unless the contract has explicit upgrade mechanisms).
Which DeFi concepts are most closely linked to Smart Contract?
Smart Contract is closely connected to Protocol, EVM (Ethereum Virtual Machine), Liquidation. Understanding how these concepts interact helps evaluate real yield, execution costs and smart-contract risk in decentralised finance.
What is the main risk or misconception around Smart Contract?
'The code is law' cuts both ways.
Which guide covers Smart Contract in practice?
Read "What Is a DAO?" for full context on how Smart Contract affects real DeFi workflows, costs and risk management.

Related DeFi glossary terms

  • Protocol In DeFi, a protocol is a set of smart contracts deployed on a blockchain that provides a specific financial service — lending, trading, yield generation, etc. Examples: Aave (lending protocol), Uniswap (trading protocol), Lido (liquid staking protocol). The term is often used interchangeably with 'platform' or 'application'.
  • EVM (Ethereum Virtual Machine) The runtime environment that executes smart contracts on Ethereum and all EVM-compatible chains. The EVM defines the instruction set and execution model for Ethereum smart contracts written in Solidity or Vyper. 'EVM-compatible' chains (Arbitrum, Optimism, Base, BNB Chain, Polygon, Avalanche, Sonic) can run unmodified Ethereum smart contracts, enabling protocol deployment across multiple chains without rewriting code.
  • Liquidation The automatic closure of a borrower's collateralised position when the collateral value falls below the required ratio. In DeFi lending, smart contracts and liquidation bots execute this without human intervention. Liquidated borrowers typically receive a smaller amount of collateral back after a liquidation penalty is deducted.
  • zkEVM A zero-knowledge rollup that is Ethereum Virtual Machine compatible — able to execute and prove Ethereum smart contracts using zero-knowledge proofs. zkEVMs combine the EVM's smart contract compatibility with zkRollup security and efficiency. Building a zkEVM is technically more complex than an optimistic rollup, but eliminates the 7-day challenge period, enabling faster withdrawals to Ethereum mainnet. Polygon zkEVM, zkSync Era, Scroll, and Linea are the leading zkEVM implementations.
  • Gauge A smart contract mechanism on Curve Finance (and protocols using similar ve(3,3) designs) that controls the flow of token emissions to a specific liquidity pool. Gauge weights are determined by weekly votes from veCRV holders — pools with more votes receive more CRV emissions. This creates a market where protocols bribe veCRV holders to vote for their pool's gauge, known as 'gauge bribing' or 'the Curve Wars'.
  • Oracle A service that provides external data — typically asset prices — to smart contracts on a blockchain. DeFi protocols rely on oracles to determine collateral values and trigger liquidations. Chainlink is the dominant decentralised oracle network. Oracle manipulation is a common attack vector in DeFi exploits.