Beginner
Events & Logs — Hands-on
Understand how contracts emit data to the chain.
Developer Beginner
5/7 — Events & Logs — Hands-on
See it liveEvents click once you watch them appear in receipts and filters. Work on a testnet so you can emit freely and compare explorer UI fields to the ABI.
Steps
- Open a verified ERC-20:On a testnet explorer; inspect its Transfer logs. Note topics vs data fields.
- In Remix, emit a:Custom event with two indexed addresses and one value; send a tx and view the receipt logs.
- Use an explorer log:Filter to find events by a specific indexed address; confirm non-indexed data isn’t searchable.
- Simulate a reorg risk:Send a low-confirmation tx, observe logs, then wait for more confirmations to consider them stable.
- Optional:Write a quick script (ethers.js/viem) that listens for your event filter and prints decoded arguments.