What Is Re-Entrancy and How It Was Used to Exploit a Decentralized Perpetual Exchange

in LeoFinance5 days ago

Welcome back,

Source

Investment are rewarding but we should not forget about the risk with comes with a particular investment. I had invested in some small cap coins one of which is GMX, a native token for one of the Decentralized perpetual exchange we have in the industry. It is one of the few DEX where you can do future trading. It observed an exploit recently and that lead to a loss of $40 million worth of assets. The attacker managed to steal Bitcoin, Ethereum, and other cryptos from the platform. GMX was not stolen here but it was obviously impacted and me being one of its holder has experienced a loss on top of loss once again.

How was the attack executed?

The attacker used Re-entrancy which is one of the Vulnerabilities of Smart Contracts. Here the attacker trick the system for printing in more GLP tokens without actually adding anything to the system. GLP stands for GMX liquidity provider token and based on how much liquidity you provide to the GMX DEX you are given these GLP tokens. So, here the hacker was actually able to get GLP tokens without adding anything to the pool which is obviously a bad sign as the GLP token count went up while the assets in the pool remained the same. This imbalance will harm the real GLP token holders.

Above chart explains everything clearly. Fake logic helped minting more GLP after which pool was emptied and the GLP tokens in existence increased. I hope everyone understood but in case you have not, feel free to write your doubts below in the comments.

What did GMX did for now?

For now GMX has temporarily suspended trading and minting on the platform. The good thing here is that they were able to learn about this attack or else even more assets would have been compromised. They have also offered the hacker a 10% bounty in case they return the stolen funds within the 48 hours time. It is a good deal for the hacker as GMX team promised that they will not be any legal consequences if the hacker decides to return it back to the team. Lets see if the hacker will actually decide to return the stolen funds back as if that happens GMX will rise up again.

Impact on GMX Market

We saw it falling by 30% from approximately $15 to $10 in value. I wish things will go well for GMX as I have this token in my portfolio. This incident also teaches us why we should never invest in a one single asset and always diversify our portfolio with different good tokens. In case someone was invested with his 100% money in GMX, that person might be in huge panic already but someone who has a diversified portfolio will have a better chance of handling such types of situation. If you want to learn more about this Re-entrancy attack you can read about it at Medium or Alchemy as there are some easy to understand articles published here and yes you are also welcome to ask me anything you want in the comments and I will try to answer.

Thank you, stay safe, make sure to diversify your portfolio, and Happy trading everyone.

Posted Using INLEO

Sort:  

[@PowerPaul:]

Hey buddy. Greetings! Because of your participation in the CryptoCompany community you received a vote from @CryptoCompany and its trail! Thank you for your participation in the "Banner for Boost" campaign.
Hive a great day!

!LOLZ