L07: Smart Contracts & Game Theory

Write and deploy your first smart contract, read real contracts on the blockchain, and analyze NFT market dynamics.

View Lesson Slides (PDF)

Guided Activities

1

Your First Smart Contract

Remix IDE — Link

Note

  • Remix IDE runs entirely in your browser using a simulated VM. No wallet, real ETH, or blockchain connection needed.
  1. Go to remix.ethereum.org
  2. In the left sidebar file explorer, open the "contracts" folder and click on "1_Storage.sol".
  3. Read the code — this is a simple smart contract that stores and retrieves a number.
  4. Click the "Solidity Compiler" tab (left sidebar, second icon) and click "Compile 1_Storage.sol".
  5. Click the "Deploy & Run Transactions" tab (third icon). Make sure "Remix VM" is selected as the environment.
  6. Click "Deploy." Under "Deployed Contracts," expand the contract.
  7. Call store(42) to store the number 42, then call retrieve() to read it back.
  8. Try storing a different number. Notice: each store() call costs gas (shown in the console).
Discussion: How is storing data on a blockchain different from storing it in a regular database? What makes smart contract storage permanent and verifiable?
2

Read a Real Smart Contract

Etherscan — Link
  1. Go to etherscan.io/address/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984#code
  2. This is the UNI (Uniswap) governance token smart contract, deployed on Ethereum mainnet.
  3. Click the "Read Contract" tab. Find and call: name(), symbol(), totalSupply(), decimals().
  4. Call balanceOf with this address: 0x1a9C8182C09F50C8318d769245beA52c32BE35BC — this shows a real holder's balance.
  5. Notice: anyone can read this data. Smart contracts are transparent by design.
Discussion: Why are all smart contract functions publicly readable on the blockchain? What are the privacy implications?
3

Explore NFT Market Dynamics

OpenSea — Link
  1. Go to opensea.io/rankings
  2. Note the top 5 NFT collections ranked by trading volume.
  3. Click on any popular collection. Find: the floor price, total trading volume, number of unique owners, and total supply.
  4. Calculate: what percentage of NFTs in this collection are held by unique addresses? (owners ÷ total supply × 100)
  5. Look at the price distribution — is there a big gap between the floor price and the highest-priced items?
Discussion: How does the "floor price" mechanism in NFT markets relate to game theory concepts? Why might rational holders refuse to sell below the floor?
© Joerg Osterrieder 2025-2026. All rights reserved.