Обратно към базата знания
Блокчейн и инфраструктураПоследна актуализация:

Smart Contracts

Self-executing programs deployed on a blockchain that automatically enforce the terms of an agreement when predefined conditions are met. The building blocks of DeFi, tokenisation, and programmable money.

EthereumSolidityautomationprogrammable money

Smart Contracts

A smart contract is a program stored on a blockchain that executes automatically when predetermined conditions are met. Once deployed, the code is immutable and runs exactly as written — no intermediary can alter, censor, or stop it.

How They Work

  1. A developer writes contract logic in a language like Solidity (Ethereum) or Rust (Solana)
  2. The contract is compiled and deployed to the blockchain as bytecode
  3. Users interact with the contract by sending transactions
  4. The contract executes its logic deterministically across all nodes
  5. State changes are recorded on-chain and become permanent

Why They Matter

Smart contracts transform blockchains from simple payment networks into programmable financial infrastructure. They enable:

  • DeFi protocols — lending, borrowing, trading without intermediaries
  • Token issuance — creating and managing digital assets
  • Automated settlement — instant, trustless execution of complex agreements
  • DAOs — decentralised governance and treasury management
  • Tokenisation — representing real-world assets on-chain

Key Properties

  • Deterministic — same inputs always produce same outputs
  • Immutable — cannot be changed after deployment (upgradeable patterns exist but add complexity)
  • Transparent — source code is publicly verifiable
  • Composable — contracts can call other contracts, creating complex financial primitives ("money legos")
  • Trustless — execution is guaranteed by the network, not by any party

Risks

  • Bugs are permanent — code vulnerabilities can lead to catastrophic losses (e.g. The DAO hack, 2016)
  • Oracle dependency — contracts that need real-world data rely on external data feeds (oracles)
  • Gas costs — complex operations can be expensive on congested networks
  • Complexity — auditing smart contracts requires specialised expertise

The Bigger Picture

Smart contracts are the reason blockchain matters beyond simple payments. They enable the creation of an entirely new financial system — one that is open, programmable, and accessible to anyone. Every DeFi protocol, every tokenised asset, every stablecoin runs on smart contracts.