Module 5.2: Ethereum & Smart Contracts | DeFi University
Week 5 • Module 2

Ethereum & Smart Contracts

📊 Ethereum data reflects early 2025 conditions • For live data visit Etherscan or Ultrasound.money

Ethereum: The World Computer

Ethereum, launched in 2015 by Vitalik Buterin and team, revolutionized blockchain by introducing smart contracts—self-executing programs that enable complex applications beyond simple value transfer.

Key Innovations

  • Smart Contracts: Programmable agreements that execute automatically
  • EVM (Ethereum Virtual Machine): Decentralized computing environment
  • Gas System: Fee mechanism that prevents spam and infinite loops
  • Account Model: Externally owned accounts and contract accounts
  • Composability: DeFi "money legos" that interact seamlessly

Ethereum Network Statistics (2025)

ETH Staked

32M+ ETH
~27% of supply

Validators

1M+
Securing the network

Staking APR

3-5%
Dynamic rewards

Gas Fees (L1)

$1-5
Per transaction

L2 Fees

$0.01-0.10
90-95% cheaper

Energy Use

-99.95%
Since The Merge

Where to Find Current Data

  • Etherscan: Transactions, contracts, gas tracker
  • Ultrasound.money: ETH supply and burn metrics
  • L2Beat: Layer 2 TVL and metrics
  • Beaconcha.in: Validator and staking data

Understanding Smart Contracts

Smart contracts are programs stored on the blockchain that automatically execute when predetermined conditions are met. They power everything from DeFi protocols to NFTs.

Simple Smart Contract Example

Here's a basic storage contract written in Solidity:

pragma solidity ^0.8.0;

contract SimpleStorage {
    uint256 public storedNumber;
    
    function store(uint256 _number) public {
        storedNumber = _number;
    }
    
    function retrieve() public view returns (uint256) {
        return storedNumber;
    }
}

This contract can:

  • Store a number on the blockchain
  • Retrieve that number anytime
  • Be called by anyone with ETH for gas
  • Never be changed or deleted once deployed

Real-World Smart Contract Uses

  • DeFi Protocols: Lending, borrowing, trading (Aave, Uniswap)
  • Stablecoins: Algorithmic and collateralized (DAI, USDC)
  • NFTs: Digital art, gaming items, memberships
  • DAOs: Decentralized governance and treasuries
  • Insurance: Parametric and peer-to-peer coverage

The Merge & Proof of Stake

On September 15, 2022, Ethereum transitioned from Proof of Work to Proof of Stake, reducing energy consumption by 99.95% while improving security and enabling future scalability.

Staking on Ethereum

  • Solo Staking: Run a validator with 32 ETH
  • Staking Pools: Stake any amount (Lido, Rocket Pool)
  • Exchange Staking: Stake through Coinbase, Kraken, etc.
  • Liquid Staking: Get stETH, rETH tokens to use in DeFi

Post-Merge Improvements

  • Energy Efficiency: 99.95% reduction in power usage
  • ETH Issuance: ~90% reduction, often deflationary
  • Security: Higher cost to attack the network
  • Withdrawals Enabled: Shanghai upgrade (2023) allowed unstaking
  • MEV Rewards: Validators earn from transaction ordering

Gas Fees Explained

Gas Fee Calculator

Gas Units: 0
Fee in ETH: 0
Fee in USD: 0

Gas Optimization Tips

  • Use Layer 2s: 90-95% cheaper than mainnet
  • Time Transactions: Weekends often have lower fees
  • Batch Operations: Combine multiple actions
  • Set Priority Fees: Balance speed vs cost

Layer 2 Scaling Solutions

Layer 2s process transactions off-chain and batch them to Ethereum, offering near-instant transactions at a fraction of the cost.

Layer 2 TVL TPS Fees Type
Arbitrum $3-4B 40,000 $0.01-0.10 Optimistic Rollup
Base $3-4B 2,000+ $0.01-0.05 Optimistic Rollup
Optimism $2-3B 2,000+ $0.01-0.10 Optimistic Rollup
zkSync $500M-1B 10,000+ $0.01-0.05 ZK Rollup
Polygon zkEVM $100-500M 2,000+ $0.01-0.03 ZK Rollup

Rollup Technologies

  • Optimistic Rollups: Assume transactions valid, 7-day withdrawal
  • ZK Rollups: Cryptographic proofs, instant finality
  • Data Availability: Calldata on L1, future sharding
  • EIP-4844: Blob space reducing L2 costs further

Ethereum DeFi Ecosystem

Ethereum hosts the largest DeFi ecosystem with $50B+ TVL across thousands of protocols.

Lending

Aave, Compound, Morpho

DEXs

Uniswap, Curve, Balancer

Derivatives

GMX, dYdX, Synthetix

Stablecoins

USDC, USDT, DAI

Liquid Staking

Lido, Rocket Pool, Frax

Yield

Yearn, Convex, Pendle

Insurance

Nexus Mutual, Unslashed

NFT Markets

OpenSea, Blur, Rarible

Composability in Action

Example DeFi strategy combining multiple protocols:

  1. Stake ETH on Lido → receive stETH
  2. Deposit stETH on Aave as collateral
  3. Borrow USDC against stETH
  4. Provide USDC-USDT liquidity on Curve
  5. Stake Curve LP tokens on Convex for boosted rewards

2025 Ethereum Roadmap

Upcoming Upgrades

  • Fusaka (Nov 2025): 11 EIPs including gas limit increase to 150M
  • Account Abstraction: Smart contract wallets, gasless transactions
  • Proto-Danksharding: Cheaper L2s through data blobs
  • Single Slot Finality: 12 second transaction finality
  • Statelessness: Light clients and better scalability

Innovation Areas

  • EigenLayer: Restaking for additional yield and security
  • MEV Solutions: PBS, MEV-burn proposals
  • Cross-chain: Better bridges and interoperability
  • Privacy: ZK technology integration

⚠️ Ethereum Risks to Consider

Smart Contract Bugs: Code vulnerabilities can lead to losses

Gas Spikes: Fees can surge during high demand

MEV: Front-running and sandwich attacks

Centralization Concerns: Lido controls ~30% of staked ETH

Regulatory Uncertainty: Staking and DeFi regulations evolving

✅ Ethereum Best Practices

• Always verify contract addresses on Etherscan

• Test transactions with small amounts first

• Use hardware wallets for large holdings

• Consider Layer 2s for frequent transactions

• Monitor gas prices before large operations

Test Your Knowledge

1. How much did The Merge reduce Ethereum's energy consumption?

50%
75%
90%
99.95%

2. How much ETH is required to run a validator?

1 ETH
16 ETH
32 ETH
100 ETH

3. What makes smart contracts "smart"?

They use AI
They execute automatically when conditions are met
They can predict the future
They require human approval