Smart Contracts & Ethereum
Programmable money: gas fees, the EVM, token standards, flash loans, MEV, and how Ethereum executes code on-chain.
What Is Gas?
Gas is the unit measuring computational effort required to execute operations on Ethereum. Every transaction consumes gas, from simple transfers (21,000 gas) to complex smart contract interactions (hundreds of thousands). You pay for gas in ETH, and the price fluctuates based on network demand. Gas prevents spam and compensates validators for processing your transactions.
What Is a Smart Contract?
A smart contract is a program stored on the blockchain that executes automatically when predetermined conditions are met. Once deployed, its code cannot be changed (unless specifically designed with upgrade mechanisms), and its execution is verified by every node on the network. It removes the need for a trusted intermediary by making the rules transparent and enforcement automatic.
What Is an L2 / Rollup?
A Layer 2 (L2) rollup is a separate blockchain that executes transactions off Ethereum mainnet (Layer 1) but posts compressed transaction data or proofs back to Ethereum for security. This gives users Ethereum-level security guarantees while reducing fees by 10-100x and increasing throughput, because the expensive verification work is shared across many transactions batched together.
What Is the EVM (Ethereum Virtual Machine)?
The EVM is the runtime environment that executes smart contract bytecode on Ethereum. It is a stack-based, Turing-complete virtual machine that runs identically on every Ethereum node, ensuring all nodes reach the same result for every transaction. The engine that makes Ethereum programmable, without it, Ethereum would only handle simple transfers like Bitcoin.
What Is a Token Standard (ERC-20 Explained Simply)?
ERC-20 is a standard interface that all fungible tokens on Ethereum follow. It defines a common set of functions (transfer, balanceOf, approve, transferFrom) so that any ERC-20 token works with any wallet, exchange, or DeFi protocol without custom integration. It is why you can trade thousands of different tokens on Uniswap with one interface, they all speak the same language.
What Is an NFT Standard (ERC-721/1155 Explained Simply)?
ERC-721 is the standard for non-fungible tokens (NFTs) on Ethereum, tokens where each one has a unique ID and is not interchangeable with another. ERC-1155 is a multi-token standard that handles both fungible and non-fungible tokens in one contract, reducing gas costs for collections. Together they define how unique digital ownership works on Ethereum.
What Is a Smart Contract Audit?
A smart contract audit is a systematic review of a contract's source code by independent security experts to identify vulnerabilities, logic errors, and potential exploits before deployment or before users deposit significant funds. Not a guarantee of safety, it reduces risk by catching known patterns of bugs, but no audit can certify code as perfectly secure.
What Is a Reentrancy Attack (Plain Language)?
A reentrancy attack exploits a smart contract that sends ETH or calls an external contract before updating its own state. The attacker's contract receives the ETH, immediately calls back into the vulnerable function (re-entering it), and withdraws again before the original transaction finishes updating the balance. This loop drains the contract's funds repeatedly in a single transaction.
What Is a Flash Loan?
A flash loan is an uncollateralized loan that must be borrowed and repaid within the same blockchain transaction. If the borrower fails to repay by the end of the transaction, the entire transaction reverts as if it never happened, meaning the lender faces zero risk. This enables arbitrage, liquidation, collateral swaps, and other complex operations without any upfront capital.
What Is MEV?
MEV (Maximal Extractable Value) is the profit that block producers (validators/miners) or specialized searchers can extract by reordering, inserting, or censoring transactions within a block. It includes front-running trades, sandwich attacks, and arbitrage, all made possible because block producers choose the order in which transactions execute.
What Is a Sequencer (In a Rollup)?
A sequencer is the entity in a Layer 2 rollup that receives user transactions, orders them, executes them, and publishes the results (plus compressed transaction data) to Ethereum L1. It provides fast confirmations (sub-second) by immediately processing transactions rather than waiting for L1 block inclusion. Most L2 sequencers are currently centralized, a single operator run by the rollup team.
What Is Calldata?
Calldata is the read-only input data attached to an Ethereum transaction that tells a smart contract which function to call and what arguments to pass. It is encoded as hexadecimal bytes following a specific ABI encoding scheme. For rollups, calldata is also the mechanism for posting compressed L2 transaction batches to Ethereum L1, making it a critical cost factor for L2 fees.
What Is a Precompiled Contract?
A precompiled contract is a special contract at a fixed Ethereum address whose logic is implemented natively in the client software (Go, Rust) rather than as EVM bytecode. They provide complex cryptographic operations (elliptic curve math, hashing, signature verification) at predictable, lower gas costs than equivalent EVM execution would require.
What Is Account Abstraction?
Account abstraction (AA) removes the rigid distinction between externally owned accounts (EOAs, controlled by private keys) and smart contract accounts. It allows any account to define custom validation logic, enabling features like social recovery, multisig, session keys, gas sponsorship, and batched transactions without requiring separate infrastructure for each. ERC-4337 is the leading standard implementing AA on Ethereum without protocol changes.