Register and share your invite link to earn from video plays and referrals.

BuidlGuidl.eth
@buidlguidl
Building products, tools, and tutorials for the Ethereum ecosystem. ๐Ÿ‘‰ ๐Ÿ‘‰
263 Following    6.9K Followers
Solidity error handling, by gas cost: โ€ข `require(cond, "msg")` โ€” ~50 gas per byte in the message string โ€ข `revert SomeError(arg)` โ€” ~22 gas per call + a 4-byte selector Etherscan decodes named errors with their args. require strings are just opaque bytes in the revert data.
Show more
Challenge 1: Crowdfunding. The exercise: โ€ข Write a campaign contract with a goal and a deadline โ€ข Funders pay in, the contract holds ETH โ€ข On success: creator withdraws โ€ข On failure: funders get a refund
Show more
Events vs state, rule of thumb: โ€ข Frontend needs to know it happened โ†’ emit an event โ€ข Contract needs to act on it later โ†’ write state