Smart Contracts

Programs that live on a blockchain and run exactly as written when triggered.

In one minute

Heads up: Educational only — not financial advice. Never share your seed phrase. Test with small amounts first.

How smart contracts work (plain English)

Two account types

  • EOA (Externally Owned Account): A wallet you control with a private key.
  • Contract account: Code + storage on-chain. It has an address, just like a wallet.

Functions & state

  • Read-only (view): Free to read off-chain via RPCs; doesn’t change state.
  • State-changing (write): Requires a transaction and gas; updates storage.
  • Events (logs): Contracts emit logs that UIs and indexers can watch.

Transactions & gas

You call a function → your wallet builds a transaction → validators include it in a block. You pay gas for computation and storage. Complex actions cost more.

ABI & interfaces

The ABI is a standardized description of functions and events. Wallets and apps use it to know how to talk to the contract.

What are they used for?

Escrow & payments

Hold funds until conditions are met (e.g., both parties confirm delivery). Removes the need for a trusted middleman.

DeFi building blocks

Exchanges, lending, stablecoin issuance, yield strategies — all automated by code.

NFTs & tickets

Mint, transfer, and track ownership of unique items like art, memberships, or event passes.

See also: dApps, DeFi, NFTs.

Common token standards (quick tour)

Patterns you’ll see a lot

1) Escrow (buyer/seller)

  1. Buyer deposits funds to the escrow contract.
  2. Seller delivers goods/service.
  3. Buyer confirms → contract releases funds (or refunds on timeout/dispute).

2) Multisig & timelock

3) AMM (automated market maker)

4) Crowdfunding / vaults

Oracles & “outside world” data

Blockchains can’t fetch web data by themselves. Oracles deliver prices, weather, sports results, and more to contracts. Designs vary in speed, cost, and trust assumptions.

Deployment & upgrades

Risks & how to manage them

Tip: Prefer well-known contracts, read docs, verify addresses, and start with tiny test transactions.

Fees & confirmations (what to expect)

Beginner checklist

  1. Right chain? Make sure your wallet network matches the contract’s chain.
  2. Official address? Copy contract addresses from official docs/websites.
  3. Allowance scope? Approve the smallest amount you need; revoke unused approvals later.
  4. Audit & controls? Look for audits, timelocks, and multisig governance.
  5. Test first: Send a tiny amount before doing the main transaction.
  6. Keep gas: Hold a little native coin for fees.

Educational content only. Do your own research.

Quick glossary

More crypto topics