# Smart contracts: programmed rules, examples and outside promises

A smart contract is code and stored data at a blockchain address. A transaction can invoke its functions, and nodes check the resulting execution. The contract enforces its programmed conditions; it cannot independently know whether an outside event happened, and correct execution does not prove that its rules are safe or fair.

Evidence: [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md); [Ethereum Virtual Machine](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/evm/index.md)

Canonical: https://degreesofsatoshi.com/encyclopedia/ethereum-smart-contracts/
Published: 2026-10-02
Substantively modified: 2026-10-02
Independently verified by an automated reviewer: 2026-10-02T18:16:35.976Z

AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied.

## Key facts

- **Components:** Code plus persistent state ([Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md))
- **Invocation:** Transactions or calls trigger execution ([Ethereum transactions](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/transactions/index.md); [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md))
- **Outside information:** Needs an external input mechanism such as an oracle ([Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md))

## Code supplies the rule; state records the current position

A contract can contain a rule that a particular signer may release funds, while storage records how much is deposited and whether release has already occurred. Nodes re-execute the rule when evaluating a transaction.

The familiar phrase self-executing can mislead. A contract does not wake itself because a calendar date arrived; a transaction or another execution path must trigger the action, and somebody supplies the required fee.

Evidence: [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md); [Ethereum Virtual Machine](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/evm/index.md)

## Example: an escrow can check a signature but not a delivery van

Imagine a contract holding 0.05 ETH until a designated buyer approves release. It can verify the buyer’s authorization and transfer the funds when its conditions hold. Repeated release can be blocked by stored state.

It cannot inspect a parcel on its own. If release depends on delivery, the design needs a trusted signer, an oracle or some dispute arrangement. That external dependency is part of the product even though the transfer is onchain.

Evidence: [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md); [Ethereum accounts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/accounts/index.md)

## A preview and an included failed call have different effects

An eth_call runs against a selected state without publishing a transaction. It can show a return value or failure under those inputs, but does not establish that a later signed transaction will see the same state.

An included transaction that reverts rolls back its execution’s state changes while still paying for consumed gas. REVERT can preserve unused gas; it does not refund all work already done. A caught nested failure can coexist with a successful top-level receipt, so inspect the actual application result.

Evidence: [Ethereum JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/); [REVERT instruction](https://eips.ethereum.org/EIPS/eip-140); [Embedding transaction status code in receipts](https://eips.ethereum.org/EIPS/eip-658); [Gas and fees](https://ethereum.org/en/developers/docs/gas/); [Solidity: Delegatecall and Libraries](https://docs.soliditylang.org/en/v0.8.30/introduction-to-smart-contracts.html)

## A fixed address can still sit inside a changeable application

Some applications use proxy patterns or configuration controls that let authorized parties change behavior. The address remaining the same does not establish that the rules or implementation remain the same.

Conversely, fixed code can preserve a bug as effectively as a useful rule. To understand a contract, identify both its executable conditions and its control structure, rather than treating smart as a quality guarantee.

Evidence: [Upgrading smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/upgrading/index.md); [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md)

## Questions

### Is a smart contract necessarily a legal contract?

The technical term describes a program. Its name does not by itself establish a legal agreement, enforceable rights or a real-world counterparty.

Evidence: [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md)

### Can a smart contract fetch a website by itself?

Ordinary contract execution cannot independently retrieve arbitrary offchain information. An oracle or another submitted input must bring that information into the system.

Evidence: [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md)

### Does a contract always need a website?

No. A website is one interface. The contract can remain callable through other compatible software if its code, network and access conditions permit it.

Evidence: [Interacting with smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/interacting/index.md)

## Claims and scope

### ethereum-smart-contracts-quick-answer

A smart contract is code and stored data at a blockchain address. A transaction can invoke its functions, and nodes check the resulting execution. The contract enforces its programmed conditions; it cannot independently know whether an outside event happened, and correct execution does not prove that its rules are safe or fair.

Scope: {"collection":"ethereum","dataAsOf":null,"blockHeight":null}

### ethereum-smart-contracts-fact-components

Components: Code plus persistent state

Scope: {"collection":"ethereum","dataAsOf":null,"blockHeight":null}

### ethereum-smart-contracts-fact-invocation

Invocation: Transactions or calls trigger execution

Scope: {"collection":"ethereum","dataAsOf":null,"blockHeight":null}

### ethereum-smart-contracts-fact-outside-information

Outside information: Needs an external input mechanism such as an oracle

Scope: {"collection":"ethereum","dataAsOf":null,"blockHeight":null}

## Sources

- [Introduction to smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/index.md) — ethereum.org contributors. Supports contract code/state, deterministic rules, illustrative vending logic, external-data limits and multisignature access. Locator: What is a smart contract; a digital vending machine; limitations; multisig. Retrieved: 2026-10-02T14:35:40.398357+00:00.
- [Ethereum Virtual Machine](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/evm/index.md) — ethereum.org contributors. Supports deterministic execution, opcodes and the distinction between temporary execution memory and persistent state. Locator: State transition function; EVM instructions; storage. Retrieved: 2026-10-02T14:35:40.399163+00:00.
- [Ethereum transactions](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/transactions/index.md) — ethereum.org contributors. Supports nonce ordering, value versus calldata, signed transaction fields, receipts and transaction inclusion. Locator: What is a transaction; the data field; transaction lifecycle. Retrieved: 2026-10-02T14:35:40.399251+00:00.
- [Ethereum accounts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/accounts/index.md) — ethereum.org contributors. Supports accounts versus wallet software and account state fields. The older empty-code EOA description is qualified using EIP-7702. Locator: Account types; an account examined; a note on wallets. Retrieved: 2026-10-02T14:35:40.369782+00:00.
- [Interacting with smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/interacting/index.md) — ethereum.org contributors. Supports read-only calls, state-changing transactions, ABI decoding and limits of simulation. Locator: Reading; writing; understanding contract ABIs; events and logs; simulating. Retrieved: 2026-10-02T14:35:40.398262+00:00.
- [Upgrading smart contracts](https://raw.githubusercontent.com/ethereum/ethereum-org-website/dcc900ff125891da5b6c723b905a7113cf1bd864/public/content/developers/docs/smart-contracts/upgrading/index.md) — ethereum.org contributors. Supports separation of deployed code from changeable application behavior and upgrade authority. Locator: What is a smart contract upgrade; proxy patterns; limitations. Retrieved: 2026-10-02T14:35:43.712296+00:00.
- [Ethereum JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/) — ethereum.org contributors. RPC response fields, transaction receipts, call simulation and log filtering. Locator: eth_getTransactionByHash; eth_getTransactionReceipt; eth_call; eth_getLogs; eth_getCode; eth_estimateGas; eth_getBalance; eth_getStorageAt; eth_getTransactionCount; default block parameter. Retrieved: 2026-10-02T17:03:42.060Z.
- [REVERT instruction](https://eips.ethereum.org/EIPS/eip-140) — Ethereum Improvement Proposals. State rollback and remaining gas behavior for a REVERT instruction. Locator: Specification. Retrieved: 2026-10-02T17:03:42.150Z.
- [Embedding transaction status code in receipts](https://eips.ethereum.org/EIPS/eip-658) — Ethereum Improvement Proposals. Receipts report top-level execution success or failure. Locator: Specification. Retrieved: 2026-10-02T17:03:42.150Z.
- [Gas and fees](https://ethereum.org/en/developers/docs/gas/) — ethereum.org contributors. Execution resource units, fee components and gas expenditure. Locator: What is gas?; Base fee; Priority fee. Retrieved: 2026-10-02T17:03:41.688Z.
- [Solidity: Delegatecall and Libraries](https://docs.soliditylang.org/en/v0.8.30/introduction-to-smart-contracts.html) — Solidity contributors. Execution uses another contract’s code in the caller’s context and storage. Locator: Delegatecall and Libraries; Storage, Memory and the Stack; Logs; Message Calls. Retrieved: 2026-10-02T17:03:42.822Z.

## Revision history

- 2026-10-02: First publication after primary-source research and independent automated verification.
- 2026-10-02: Expanded explanation: A preview and an included failed call have different effects. Worked examples are illustrative; source checks and independent verification are recorded separately.

## Cite this entry

Degrees of Satoshi editorial project. “Smart contracts: programmed rules, examples and outside promises.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/ethereum-smart-contracts/
