Skip to main content
← DeFi glossary

Glossary · S

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).

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).
How does Smart Contract work 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.
Can you give an example of Smart Contract?
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.
What do people get wrong about Smart Contract?
'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.

Related terms (S)