Information and guides
▶ Simulation

Smart contracts: rules executed by code

What you will learn

Write an if–then rule for a game and describe what happens if the coded condition is wrong.

A smart contract is a program on a blockchain that executes defined rules when invoked.

A smart contract is not necessarily AI or a legal agreement. On Ethereum, an action can invoke code that validating nodes check under the same rules. This supports games, voting and conditional asset transfers. Code does not understand intentions: programming errors or broad administrator permissions can cause harm. A contract does not simply wake up on a clock; an action must invoke it, sometimes through an external automation service.

In a fictional game, a contract transfers a digital badge when three completed tasks are recorded. It checks the coded condition, not whether the player understood the material.

Write an if–then rule for a game and describe what happens if the coded condition is wrong.

Ethereum.org · Smart contracts ↗

Check your understanding

What is a smart contract?

  • An AI investment adviser
  • A program executing rules on a network
  • A legal promise of profit
Answer and explanation

A program executing rules on a network. Smart refers to programmed execution, not human judgment.

What can happen if a contract condition contains a bug?

  • The code may perform an unwanted action
  • The network always corrects the intended meaning
  • Losses are impossible
Answer and explanation

The code may perform an unwanted action. Network validation does not guarantee that the programmed rules are appropriate.

Continue learning

Price-to-Earnings (P/E): What is the price relative to earnings? — The price-to-earnings (P/E) ratio is the share price divided by earnings per share. It is a ratio, not a forecast and not a buy recommendation.

Two funds: Did we really diversify? — Different funds can hold the same companies. Check cumulative exposure, not just the number of funds.

Crypto: What Is Bitcoin? — A cryptographic asset is a digital asset that operates using cryptographic rules and a network of computers.

Report a correction

Try as a guest