‘solana program close’ | The Half Million Dollar Oopsie

in LeoFinance9 months ago


Don't rush when building.

I came across this article the other day about a DeFi project being killed when one dev made an oopsie. My first reaction was "damn, that sucks", followed immediately by laughter when I read their official announcement. To add insult to injury, this project was built on Solana, which I was 100% sure the reason it died... But I was wrong. So I won't spend this whole article talking shit about Solana, even though I could. If you wanna read some of my works about Solana, I've written quite a few and they are spicy:

So as you can see, I am not a supporter of it at all, and sincerely hope that people wake up and stop using this sad excuse for a blockchain. Anyway - enough about how shitty Solana is. Back to the real laughing matter at hand. OptiFi is was a DeFi protocol built on top of Solana, similar to something like Uniswap. Obviously, a lot smaller, but you get my point. The devs were slaving away at an update for the protocol and decided it was time to go ahead and push the update.

That's when disaster struck. The dev that was running the terminal and pushing the update made a fatal mistake. In the article linked, you can see the exact snippets of commands that the dev input into the terminal and you can see exactly where he fucked up. In simple terms, he used a command that completely killed the project by permanently shutting it down on the Main net instead of using a command that would halt the program for the update.


'solana program close'

That fatal line of code permanently shut down the deployed program, making its Program ID invalid. This means that it can never be deployed again without a new Program ID, which means the funds that were locked in the program are now locked permanently. They even included a link to the Solana block explorer if you wanna take a gander at a $661,000 fuck up. As you can see, the execution was successful and the Program ID optFiKjQpoQ3PvacwnFWaPUAqXCETMJSz2sz8HwPe9B was closed permanently.


This means they can no longer re-deploy the Program, and all funds associated with it are unretrievable. The funds lost total around $661,000 in USDC according to DeFi Llama, which has the funniest chart I've ever seen when you go to the OptiFi page. "OptiFi mainnet program was closed by mistake" and then the value crumbled because it's basically nullified. That's what we call a big oof, lads. A very big oof.


The good thing is, OptiFi was set to settle deposits this morning and begin the process of refunding users. Of the $661,000, only roughly $33,000 seemed to be customer funds which is a great thing. The rest of the funds belonged to the devs/project so you can imagine how big of a financial hit they're taking. Hopefully everyone that had funds sitting in the protocol gets their assets back. This is a very expensive lesson, and hopefully one we can all learn from.

When you are dealing with brand new technology, there are always risks. The code and way the programs work will differ from anything you've dealt with in the past. This is why it's important not to rush when executing commands like this that involve user's funds. Maybe run tests beforehand on the test network? Is that not what the test nets are for? Come on people. Even looking at the official Solana CLI docs, you can see there needs to be further clarification one how these commands work.


Maybe have a caution next to the 'solana program close' command that lets you know, it will permanently kill the Program ID associated. 'to close a single account' just sounds like it will stop the process and can easily be re-deployed. This is obviously not the case.

Lessons to be learned here:
1. Don't use Solana (lol).
2. Don't rush when coding
3. Only play with money you are willing to lose

Hope you had a laugh reading about this huge oopsie.


Thanks for reading! Much love.

Wanna learn about all kinds of things you can do with the crypto you earn blogging on Hive? Check out my index - Learn Crypto Stuff for some fun educational crypto stuff.

Posted Using LeoFinance Beta


Congratulations @l337m45732! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You distributed more than 47000 upvotes.
Your next target is to reach 48000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

Hive Power Up Month Challenge 2022-08 - Winners List
Be ready for the 9th edition of the Hive Power Up Month!
Hive Power Up Day - September 1st 2022

Always best to do ones research in the crypto world. Or lose everything we've all worked for.

Posted Using LeoFinance Beta

this is the basics, for sure

Posted Using LeoFinance Beta

That's a terrific development. The last lesson you shared is just the hit "Only play with money you are willing to lose". Caution is quite a necessary Financial PPE. never dip both feet un an unknown water.

Posted Using LeoFinance Beta

Maybe have a caution next to the 'solana program close' command that lets you know, it will permanently kill the Program ID associated.

How about a huge red bold warning!!!

This post has been manually curated by the VYB curation project

That's a lot of fund to just push away just like that, the developer make an unretrievable mistakes, that is so sad to realise after putting yourself through.

Posted Using LeoFinance Beta

I wanted to laugh, but the fear of God held me back. Cos I can imagine how this hit will affect the devs. It's great that user's funds are less, I just hope there will be able to return them all. Gosh, a lot can happen with just a stroke of the Enter button. 😩

Posted Using LeoFinance Beta