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:
- Solana's Proof of History is Running 30 Minutes Behind
- Solana is Building a Smartphone... Why Though?
- Another Day, Another Solana Outage | #EthereumKiller
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