Library
Mastering Ethereum: Building Smart Contracts and DApps
blockchain

Mastering Ethereum: Building Smart Contracts and DApps

Andreas M. Antonopoulos & Gavin Wood 2018 15 references

How Ethereum works under the hood — keys, wallets, transactions, the EVM, Solidity & Vyper, smart-contract security, tokens, oracles, DApps, and consensus — for building, auditing, and reasoning about Ethereum smart contracts.

ethereum smart-contracts solidity evm smart-contract-security tokens dapps

Overview

The Core Framework

  • Ethereum is a deterministic, Turing-complete "world computer" — a stored-program computer fused with a blockchain; one shared world state advanced by the EVM.
  • Power is a liability. Generality (Turing-completeness, delegatecall, rich languages) is also attack surface; gas bounds execution and defensive programming keeps it safe.
  • Determinism forbids on-chain randomness — which is why oracles, off-chain storage, and external entropy exist.
  • Immutable code + irreversible value ⇒ you can't patch a deployed bug and lost keys/wrong addresses are permanent. Reuse audited code ("security by maturity").
  • Spec over implementation: Ethereum is defined by the Yellow Paper, so many interoperable clients exist by design.

Quick Lookup

Situation Do This Avoid This
Sending value Validate recipient; a wrong to burns ether Trusting an unchecked address
External calls in a contract Checks-Effects-Interactions + reentrancy guard State update after the call (the DAO)
Arithmetic Solidity ≥0.8 checks overflow (was SafeMath) Assuming uint won't wrap
Need randomness Commit-reveal / VRF / oracle block.timestamp/blockhash entropy
Calling another contract Hardcode/verify the address; new or known address Casting an arbitrary address to a type
Backing up a wallet Store the BIP-39 mnemonic offline Relying on the password alone
Writing a contract Reuse OpenZeppelin; minimize complexity Rolling your own crypto/token

The Key Insight

Ethereum is a "single shared-state...world computer" — and because that computer is open, immutable, and adversarial, its power is inseparable from its risk. (Core thesis, Chapters 1 & 13)

Key Diagrams: Key→Address→Transaction→EVM flow · Reentrancy & Checks-Effects-Interactions

References