Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
Etherscan is the most important tool in Solidity development that isn't a compiler. Every deployed contract has an Etherscan page showing its bytecode, transaction history, and (if verified) source code and ABI. Learning to 'read' a contract on Etherscan — to look at its storage, its recent calls, its inherited contracts — is the single best way to learn from professional code.
Etherscan's Contract tab shows ABI-decoded function calls, internal call traces, state diffs, and — if the contract is verified — the exact Solidity source the deployer compiled from. Because Solidity compilation is deterministic, anyone can re-compile the source and confirm the on-chain bytecode matches, which is what verification proves.
Go to: https://etherscan.io/address/0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Tabs to visit (in order):
1. "Contract" → "Code"
- You'll see verified Solidity source. Read the constructor; read 'addLiquidity'.
- Scroll down: 'Contract Source Code (Solidity Standard Json-Input format)'.
2. "Contract" → "Read Contract"
- Every view function of the contract with a UI.
- Try calling 'factory()' — it returns another contract's address.
3. "Contract" → "Write Contract"
- Every state-changing function. You'd connect a wallet to call them here.
- Skim 'addLiquidityETH' — look at the parameters.
4. "Transactions" tab
- The 200 most recent transactions. Click one — see the input data, the logs.
5. "Events" tab
- Every event emitted by this contract in reverse chronological order.addLiquidity function and read it top to bottom.factory(). It returns an address. Click through to that address — it's a different contract.totalSupply? Its owner?Use these three in order. Each builds on the one before.
Explain what 'verifying a contract on Etherscan' means. Why would a developer verify their contract — what do users gain, and what does the developer give up?
Etherscan's 'Read Contract' tab lets users call any view function via a wallet. Walk me through what's happening on the network when I click that button — RPC? Signature? Gas?
A contract is verified on Etherscan but its actual deployed bytecode doesn't match the source. How does this happen (compiler version mismatch, metadata hash drift, optimizer settings)? How do you audit for it?