2. useMemo β runs calculateTotal live as user types amounts. Only re-runs when input changes.
3. 9 unit tests with Vitest β commas β newlines β decimals β empty strings β non-numbers β Why test so thoroughly? Because calculateTotal determines how many tokens go on-chain.
Big session today. Three things shipped π§΅π
1. readContract β fetched ERC20 allowance inside handleSubmit using wagmi core (not the hook). Know when to use each. Hook = reactive UI. Core = you control when it fires.
π₯#Web3#wagmi#BuildInPublic#LearningInPublic@CyfrinUpdraft
Built the airdrop form today with AI
β Simple UI? Let AI draft it. Review it. Ship it.
β οΈ Complex logic + blockchain?
What I built:
β Reusable InputField component (AI)
β AirdropForm with 3 useState hooks (me)
β tokenAddress + recipients + amounts β all controlled inputs
Added RainbowKit to my Web3 dApp today π
Key lesson: it's not just about the connect button
β Wrap app in WagmiProvider
β QueryClientProvider
β RainbowKitProvider
β Configure your chains
β Store your projectId in .env
@CyfrinUpdraft#BuildInPublic#RainbowKit#Web3ββ
In building full-stack web3 projects, most people want to start coding immediately.
Follow along if you're learning Web3. We're just getting started. β‘
I've learned to read the contract first. Here's why π§΅π
#Web3#BuildInPublic#ERC20@CyfrinUpdraft
4/ This is the part they don't tell beginners about Web3 frontend dev β you're not just building UI. You're building a bridge between users and a blockchain.
Yeppp, this is what I do.
I build websites & mobile applications for businesses β turning ideas into fast, functional, and beautiful digital products.
Got a design? I collaborate with UI/UX designers to bring your vision to life, pixel-perfect, using clean code.
β Built get balance + withdraw functions using viem's PublicClient
β Fund, getBalance & withdraw all follow the same pattern once it clicks β Migrated the whole project from JS to TypeScript with Vite
Debugging is part of the process.
Section 3 nextβ‘
#LearningInPublic#Web3
Web3 dev log β Section 2 done β
Highlights from today:
β Hit a real bug: MetaMask kept connecting to Ethereum instead of my local Anvil chain β no funds, no transactions. Fixed it by switching networks manually and using Anvil's test accounts
#Web3@CyfrinUpdraft
Web3 dev log π§΅
Today I learned:
β Always detect the user's chain before sending any transaction
β Simulate transactions with viem before executing βcatch errors before they cost gas
β Use Anvil as a local blockchain to test your frontend
#Web3#LearningInPublic#Blockchain
I built a Web3 app today. The button said "Connected" β MetaMask had no idea I existed π
One missing line of JavaScript.
This is what learning blockchain actually looks like π§΅
I called requestAddresses() to trigger the MetaMask popup.
It worked. I clicked "Connect."
But I never saved what it returned.
So my app knew MetaMask existed... but had zero idea WHICH wallet just connected π«