LearnViz CompSci
Home / Learn / Emerging & Frontier Topics / Smart Contracts

Intermediate Topic 20 of 51 Emerging & Frontier Topics

Smart Contracts

Programs executing on a blockchain.

How it works

A smart contract is a program stored and executed on a blockchain whose results every node verifies. On Ethereum, contracts are written in languages such as Solidity, compiled to bytecode for the EVM and called through transactions that pay gas fees proportional to computation. Contract state and code live at an address, and execution is deterministic and cannot be changed once deployed unless built to be upgradeable. Events log activity, oracles bring outside data in and standards such as ERC-20 and ERC-721 define tokens.

Where it is used

They run decentralized exchanges, lending, token issuance, voting and automated escrow without a central operator.

Common pitfall

Bugs are costly because code is public and immutable, and famous hacks such as the DAO and many reentrancy attacks drained funds. Audit code, use well-tested libraries, test extensively and limit privileges and upgrade paths.

Where it fits in the course

Smart Contracts is topic 20 of 51 in Emerging & Frontier Topics, rated Intermediate. It follows Proof of Work and Proof of Stake. The next topic is Cryptocurrencies.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Emerging & Frontier Topics quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Smart Contracts?
Programs executing on a blockchain. It belongs to Emerging & Frontier Topics and is an intermediate-level topic.
Where do people use Smart Contracts?
They run decentralized exchanges, lending, token issuance, voting and automated escrow without a central operator.
What is the most common mistake with Smart Contracts?
Bugs are costly because code is public and immutable, and famous hacks such as the DAO and many reentrancy attacks drained funds.
What should I learn before this topic?
Start with Proof of Work and Proof of Stake, the topic just before it in Emerging & Frontier Topics.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Emerging & Frontier Topics quiz.
Is Smart Contracts hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Smart Contracts?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Smart Contracts?
Proof of Work and Proof of Stake, Cryptocurrencies, Blockchain are closely connected. The full list is in the related topics section of this page.
What should I study after Smart Contracts?
Continue with Cryptocurrencies, the next topic in Emerging & Frontier Topics.

Related topics