In this track: Meet smart contracts
beginner · 3 MIN READ

What is contract bytecode?

Machine-readable instructions differ from human-readable Solidity.

LET’S PICTURE IT

A recipe written for a cook and instructions encoded for a kitchen machine express related operations in different forms.

SEE IT FOR YOURSELF
Watch a stack machine execute a tiny programStep 1 / 4
Watch a stack machine execute a tiny programProgram→ PUSH1 0x02PUSH1 0x03ADD · STOPStackEmptyPC = 0A fixed local model; not a complete EVM implementationPUSH1 0x02Push immediate 2Next PC = 2Stack · top first2PUSH1 occupies one opcode byte plus one immediate bytePUSH1 0x03Push immediate 3Next PC = 4Stack · top first32The first value is below the most recently pushed valueADD3 + 2 = 5Next: STOP at PC 5Stack5No automatic SSTOREStack, memory and persistent storage are different locations

The program bytes are PUSH1 02, PUSH1 03, ADD, STOP. The program counter begins at byte zero.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

The EVM executes encoded instructions

Bytecode is a sequence of bytes interpreted according to EVM rules. Instructions can manipulate the stack, read call input and interact with memory or storage. A contract’s source code is not directly read as English during execution.

Compilation chooses a representation

A Solidity compiler turns source and settings into executable artifacts. Different compiler versions, optimization choices and linked dependencies can affect the produced bytes. The exact build context matters when comparing source with deployment.

Creation and runtime code differ

Creation code runs when creating a contract and returns the runtime code to install. Constructor-only logic is not simply another normal callable function in the deployed runtime interface.

Bytecode is not an ABI

An ABI describes how applications encode and decode an interface. It is not the machine implementation of every permission and branch. Explore the EVM stepper for a tiny instruction example, then compare that with the ABI lab’s function request.

QUICK CHECK · NO PRESSURE

Does an ABI contain every instruction executed by a contract?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.