NFTs, dApps, Web3, Programming, React

A Funny Experience I Had with an NFT Minting dApp

Or, “Why my minting app alerts are purposefully boring nowadays.”

Photo by Call Me Fred on Unsplash

Taking a quick break from coding a web3 NFT minting dApp this morning because I was just reminded of something quirky that happened on a previous mint (I can’t recall which one), where I was trying to be clever / funny, and it backfired.

[I promise, this will be the only technical part here… you can skip this paragraph if you like.] In my minting functions in React, I use try/catch blocks to handle various errors. And I have a couple of different minting functions I call in my scripts. So, for the sake of efficiency, I keep an object of various errors and error messages up near the top of my script, and then I iterate through that list of errors within the try/catch block of each mint function.

In this way, I can have a nice, clean, tidy section listing pretty much any error that Metamask throws up based on its interaction with my smart contracts. And, this also makes the error messages really easy to customize throughout the app, if I like.

And so this is where I decided to get creative for a mint earlier this year. I forgot which one it was, but it was a fairly active one — maybe it was Praying Hands Club. Instead of throwing up…

--

--