BuildBot

Reading the Chain

Tokens, NFTs & reading a contract

Lesson 5 of 5

A token is a contract that keeps a balance mapping. Call its functions by hand with eth_call, decode the 32-byte answers, and the ABI stops being a mystery.

What you'll learn

  • Explain an ERC-20 token and an ERC-721 NFT as contract state, not as files or coins
  • Encode a function call by hand: 4-byte selector plus 32-byte padded arguments
  • Read a live stablecoin's decimals, total supply and a balance with eth_call
Members only

A free account unlocks this lesson and every other one.

Runnable challenges, knowledge checks, and progress that syncs across your devices. No card needed.

Not sure yet? Try the free lesson first: What a blockchain actually is