Skip to content
BENIBIX Learn

Smart Contract

Development⛓️ Blockchain & Web3Smart Contracts

Also known as Blockchain Smart Contract, Contract Account

A program kept on a blockchain. It runs its own rules, the same for all.

Think of it like

It is like a snack machine. Put in coins, press a button, and the snack drops out.

Example

A smart contract holds the prize money for a chess game. When the game ends, it pays the winner with no referee.

Why it matters

Strangers can make a deal and trust the code instead of each other. Tokens, NFTs and dApps are all built from contracts.

Definition

A smart contract is a program that lives on a blockchain at its own address. It holds code and data, and it runs when someone sends it a transaction. Its rules run just as written, and no one can stop them halfway. Once it is out, its code most often cannot be changed or deleted. It cannot see the outside world, so it gets things like prices from a helper called an oracle.
The contract sits on the chain at its own address and runs when called.

Common mistake

Putting it live before a careful check. A bug in a live contract is public, and most can't be fixed.

Key takeaways

  1. 1
    Code is the rule. It does exactly what it says.
  2. 2
    Runs on request. A transaction starts each run.
  3. 3
    Hard to change. Published code usually stays.

Compare