B.BlockAxis⌕ Search
Menu

EVM and smart contract composability

The Ethereum Virtual Machine executes instructions deterministically.

IntermediateContent revised · 13.09.20264 min reading · allow 5–10 more minutes for the workshopBlockAxis
← My learning journey
Workshop · 20 XP

Awarded once after a correct answer.

The question we will work through

Trace execution and rollback

Useful first : Ethereum accounts and transactions · Ethereum gas and EIP-1559

Reading path · 10 / 41 · Intermediate

Key takeaway

The Ethereum Virtual Machine executes instructions deterministically.

The essentials

The Ethereum Virtual Machine executes instructions deterministically. Nodes starting from the same state and processing the same operations should reach the same result. A contract cannot freely fetch an arbitrary web price during execution; external information needs an explicit input mechanism such as an oracle.

How it works

Contracts can call other contracts, combining a swap, loan and repayment in one transaction. If a failure reverts the whole transaction, its state changes are rolled back while consumed computation still costs gas. Atomicity does not guarantee that the trade was economically sensible.

What to watch

Some deployed code is immutable; proxy systems can change the logic used at a stable address. Inspect upgrade authorities, delays and key controls. An audit of one implementation does not automatically cover a later upgrade. Composability also creates dependencies: another contract’s pause or failure can affect an otherwise correct application.

Understand the details

The EVM executes instructions deterministically against a given state. Contract storage persists between transactions; temporary execution memory does not. A call can invoke another contract, which may invoke more code. This composability is useful but expands the behavior that must be considered when reviewing a seemingly simple action.

Boundaries and common mistakes

A revert rolls back state changes within the reverted scope, while consumed gas still matters. A caller may deliberately handle a failed subcall, so not every internal failure means the entire transaction failed. Upgradeable proxies add another distinction: the address a user calls can delegate behavior to implementation code that may change under governance or administrator control.

The mechanism at a glance

SEE THE CONNECTIONS
Trace execution and rollbackFour connected ideas
  1. 01Initial state
  2. 02A calls B
  3. 03Success or handled failure
  4. 04Commit or revert scope

Read these as connected concepts, not necessarily consecutive steps.

Read the explanation

The EVM executes instructions deterministically against a given state. Contract storage persists between transactions; temporary execution memory does not. A call can invoke another contract, which may invoke more code. This composability is useful but expands the behavior that must be considered when reviewing a seemingly simple action.

The distinction that changes the analysis

01State changes
02Execution cost

An attempted contract call can consume computational work before reverting. The attempted state changes are rolled back, but this does not imply a free attempt. Keep transaction status, resulting state and fees in separate columns when reading an explorer.

Explain it yourself

Revisit the case above. Name what is established, what remains to be checked and the evidence needed to conclude. A strong answer addresses both sides of the diagram.

Applied workshop · work at your own pace

Apply the lesson to a case

Contract A records an order, calls contract B, then requires a successful result. B fails and A reverts. Trace the order record, token movement and fee. Then consider how the result differs if A catches the failure and continues without moving tokens.

Why should an application inspect more than the top-level receipt?

Choose one answer.

Terms in this lesson
Oracle
A mechanism that supplies a contract with information originating outside its immediate execution context.
Gas
A measure of execution resources; gas units and the price per unit are separate quantities.
Prepare a correction note

Describe the passage and the proposed correction. This creates a local note for you to share; it sends nothing. Do not include personal or confidential information.

Sources and references

References for the mechanisms described. Numerical examples are hypothetical unless stated otherwise. Check the applicable version, network and jurisdiction.

References reviewed on 21 September 2026. All sources →