Fexi.net

Madridyeth's Ethereum Experiments

My Favourite Mistakes While Learning Solidity

December 2020

This year I wrote more broken contracts than working ones. And that’s fine.

One of the best mistakes I made was forgetting view on a getter function. Took me two days to realise I was paying gas every time I tested it on mainnet. Felt like an idiot.

Another one — I forgot to protect a function with onlyOwner. Someone called it. Didn’t lose funds but messed up state. Lesson learned.

Also made a mess with reentrancy once. Tried to write my own escrow contract. Should’ve just used an audited one. But I’m stubborn.

Learning Solidity’s been a weird ride. Half docs are outdated, half the answers on StackOverflow are wrong. But when something finally works, it’s worth it.

If you’re just starting out, don’t rush. Break things. Then fix them. That’s how you actually learn.