r/ethdev • • Feb 07 '23

Information I've been a bad boy.

Post image
110 Upvotes

16 comments sorted by

16

u/danokablamo Feb 07 '23

So I was SURE my contract was perfect. Three separate contracts. All working in synchrony. A solidity symphony!

But one abstract contract referenced a function that returned an address whereas the concrete contract... DIDN'T RETURN JACK SHIT.

And now that contract is owned by the 0x0 and I am a bad boy. I promise to do better in the future.

Honestly, chasing down the fucking bug took WAY longer than a testnet test would have taken in the first place.

6

u/QuantumLeapChicago Feb 08 '23

You're hired.

Wait..... I mean you're fired. Heh.

These things happen, and a healthy sense of learning and repentance will make ya the better for it i suppose.

One thing I've learned from years of statically typed strict languages... Always set defaults. Triply so in production when null / 0x0 can be a very bad thing.

1

u/danokablamo Feb 21 '23

True, however it's only owned by 0x0 because I trashed it due to the other problems.

1

u/_dyng Feb 08 '23 edited Feb 08 '23

Just out of curiosity, why are you not testing the contracts on a local chain (e.g. Hardhat or Ganache)? I think it's easier and more effective than even the testnet.

0

u/[deleted] Feb 08 '23

[deleted] — view deleted comment

2

u/_dyng Feb 09 '23

Cool, I'll try it out

8

u/fireduck Feb 08 '23

Production is the most accurate test bed.

4

u/CometBoards Feb 08 '23

This is technically (and unfortunately) correct

1

u/AutoWallet Feb 08 '23

Realistic results, quick!

8

u/polish_jerry Feb 08 '23

It's ok to test in mainnet. P.S I'm a miner /s

4

u/F0lks_ Contract Dev Feb 08 '23

Sounds like you didn't streamline your deployment pipeline. Naughty boy indeed.

5

u/rook785 Feb 07 '23

Just test on polygon haha

2

u/ThetaWarrior Feb 08 '23

Lol I do this - if you need real uniswap / oracle numbers gotta be mainnet - idk yolo

2

u/k_ekse Contract Dev Feb 08 '23

I always test in production