<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Skyge on Medium]]></title>
        <description><![CDATA[Stories by Skyge on Medium]]></description>
        <link>https://medium.com/@skyge?source=rss-32d7aa62b1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5LzRLEOIRjxkmfvaL1Bt5A.jpeg</url>
            <title>Stories by Skyge on Medium</title>
            <link>https://medium.com/@skyge?source=rss-32d7aa62b1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:12:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skyge/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Analyze for Saffron attack]]></title>
            <link>https://skyge.medium.com/analyze-for-saffron-attack-153c748163f1?source=rss-32d7aa62b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/153c748163f1</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Skyge]]></dc:creator>
            <pubDate>Sun, 06 Dec 2020 07:47:01 GMT</pubDate>
            <atom:updated>2020-12-06T12:07:29.943Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Saffron?</p><blockquote>A standard for tokenizing on-chain collateral.</blockquote><blockquote>Saffron is a protocol for tokenizing on-chain assets, including contracts that otherwise impair access to utilized capital. Tokenized ownership of on-chain assets gives liquidity providers greater flexibility and uninterrupted access to their underlying collateral while enabling leveraged staking and bespoke risk management.</blockquote><p>This new protocol launched on November 1st, 2020 at 2:00pm UTC, and for every epoch, it is 14 days in length.</p><p>For the epoch 0, it is passed successfully, but when came to the epoch 1, something unexpected happened.</p><p>Generally speaking, users should call <strong>add_liquidity</strong> to stake, and call <strong>remove_liquidity</strong> to unstake, all are in the orders until someone attacks the contract. There is a function named <strong>new_epoch</strong> to start a new epoch, ideally, this function can only be called by the contract deployer by the following check to start the next epoch:</p><blockquote><em>require(msg.sender == governance);</em></blockquote><p>but unfortunately, this function can be called by everyone due to they forget to add the permission check as above, so when the attacker noticed this, he began to do harm to the staking system:</p><p>At first, the attacker got some ETH from Tornado, and when the epoch 1 has started for some time, he began to attack the contract by calling the function <a href="https://etherscan.io/tx/0xac2b9dc19bebfd4b6d03be51796a61460c3bda5f6ac95863426bf8fcc564d3c2"><strong>new_epoch</strong></a><strong>. </strong>Then the attack finished, users can not withdraw their funds as expect, and the attacker seems like can not get any profits from this.</p><p>After the attack, the stage of this epoch became to 2, so the dark time came, but no one realized this, users just added liquidity as normal, and only until the epoch 1 was going to end, they found out they can not remove successfully, cause there is a limitation for withdrawing the liquidity, you can find this on their <a href="https://etherscan.io/address/0x70d8682dddd33571722d14aa327049dad869aee9#code">contract</a> at line 1332:</p><blockquote>require(token_epoch == 1, “v1: bal token epoch must be 1”);</blockquote><p>It was not until this moment that the alarm was raised. So the Saffron team began to do their best efforts to rescue all reserves. For more details, you can find at here:</p><blockquote><a href="https://medium.com/saffron-finance/saffron-epoch-1-recovery-d10b84c95940">Saffron Epoch 1 Recovery</a></blockquote><p>In the end, ensure that all permission functions have permission checking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=153c748163f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeFi Review Special Edition: Houston, We Have a Problem!]]></title>
            <link>https://skyge.medium.com/defi-review-special-edition-houston-we-have-a-problem-a705f7b26e3c?source=rss-32d7aa62b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a705f7b26e3c</guid>
            <category><![CDATA[attack]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Skyge]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 09:35:49 GMT</pubDate>
            <atom:updated>2021-04-08T23:05:09.005Z</atom:updated>
            <content:encoded><![CDATA[<p>Cao Yin, Digital Renaissance Foundation Managing Director, <br>Twitter: @CaoArmand</p><blockquote>Imagine that if everyone has the opportunity to use various free and open DeFi services in the near future, they should thank the users in DeFi who have been damaged in the past hacking incidents, and DeFi developers who are tireless and always stick to their original intentions. This thrilling journey always begins with the first steps taken by these explorers and builders, paying our high respect.</blockquote><p><strong><em>I would like to pay tribute to all DeFi users in this article, one day we will go to the moon.</em></strong></p><p><strong>Part 1: Houston，We Have a Problem</strong></p><p>At 21:07 on April 13, 1970, 55 hours and 52 minutes after the launch of the Apollo 13 to the moon, the ground control center in Houston delivered instructions to the spacecraft that had entered space to turn on the fan and stir the low-temperature oxygen tank.</p><p>As a result, the astronauts of Apollo 13 turned on the fan of the low-temperature oxygen tank 55 hours, 53 minutes and 20 seconds after the spacecraft was launched.</p><p>But just 2.7 seconds later, the spacecraft exploded violently.</p><p>The three astronauts on Apollo 13 were stunned. Astronaut Swigert immediately reported to the ground command center and said the famous line borrowed by countless people:</p><h4><strong>Houston，we have a problem.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*wZzXIKvFi7CuyxU2zcVYjA.png" /></figure><p><strong>Part2：Houston moment of DeFi</strong></p><p>Today, 50 years after the explosion of Apollo 13, human exploration of digital space has also reached a similar historic moment. Lendf.Me, the most large DeFi loan protocol in the Eastern Hemisphere, was severely attacked today.</p><p>The hack exploited the vulnerability generated by the ERC777 standard imBTC in the Lendf.ME protocol combination.</p><p>The hacker uses the vulnerability when combines imBTC, a standard ERC777 token, with Lendf.ME protocol to attack.</p><p>imBTC is the BTC token on the Ethereum blockchain launched by Tokenlon. ERC777 is a token standard launched on the basis of ERC20, it is compatible with ERC20, and added some new features on the basis of ERC20.</p><p>imBTC itself has no security issues. However, the combination of ERC777 token and Lendf.Me contract creates a re-entry attack vulnerability.</p><p>The hacker used the vulnerability to call the re-entry attack multiple times on Lendf.ME, used imBTC as a collateral to loot all assets on Lendf.Me and immediately exchange the stolen currency through DEX platforms (such as 1inch.exchange, ParaSwap and Tokenlon) into ETH and other tokens, and finally transferred the rest of the stolen money to the loan platforms Compound and Aave.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*e-pFbMFEnY0AhO72eUJIsQ.png" /><figcaption>Lendf.ME’s loan balance reached 6,732.91 repeated supply imBTC</figcaption></figure><p>According to the SlowMist, a security audit company, the cumulative loss of Lendf.Me under the attack is about $24,696,616. The specific stolen cryptos and amount are:</p><blockquote>WETH: 55159.02134,<br>WBTC: 9.01152,<br>CHAI: 77930.93433,<br>HBTC: 320.27714,<br>HUSD: 432162.90569,<br>BUSD: 480787.88767,<br>PAX: 587014.60367,<br>TUSD: 459794.38763,<br>USDC: 698916.40348,<br>USDT: 7180525.08156,<br>USDx: 510868.16067,<br>imBTC: 291.3471</blockquote><p>After being attacked, the locked value in Lendf.ME fell by 100% to $6 in an instant, and the total value of previous lockups exceeded $24.9 million. This attack not only caused a large number of user losses (including me), but also seriously damaged the confidence of DeFi developers and users in DeFi ecosystem.</p><p>After the attack, the global crypto community was full of panic and anger, and some people who were prejudiced against DeFi for various reasons even took advantage of the opportunity, including some narrow-minded people who did not understand DeFi.</p><p>Lendf.ME’s accident has its own responsible reasons. Before the investigation results came out, I didn’t intend to talk about it at here, but the stage of development of DeFi itself is a more critical cause of the accident. We must realize that the complexity of DeFi has exceeded DeFi’s maturity.</p><p>Since the DeFi explosion in the first half of last year, new assets and new protocols of the DeFi world have sprung up like mushrooms. I monitor the latest DeFi applications through Twitter and the media every day. In the past three months, I have seen that new DeFi protocols and new assets are emerging at a rate of at least two or three per day, and the composability of DeFi protocols makes the complexity of DeFi grow exponentially. The influence between has gone beyond the simple combination of Lego bricks.</p><p>But at the same time, the global DeFi team and users’ understanding of protocols and operational safety are still growing in a linear manner with Lego, so we see more and more security incidents recently, including but not limited to the flashloan attack in bZx, and the MakerDAO 0DAI auction.</p><p>The imBTC re-entry attacks in Uniswap and Lendf.ME are just another inevitable result of the mismatch between the maturity and complexity growth curves, just like the accident of Apollo 13 that year.</p><p>According to NASA’s investigation team, it was found that before the launch of Apollo 13, the command cabin had made many improvements, one of which was to increase the voltage of heater in the oxygen tank from 28 to 65 volts, but the thermal stability switch on the heater has not been modified correspondingly, and the voltage is still 28 volts. So when working, the thermal stability switch melted, and a tragedy happened.</p><p>How similar this is to Lendf.ME’s imBTC re-entry attack! All are disasters caused by the incompatibility between the new system components and the old system. Lendf.ME was developed according to the open source Compound protocol V1. The developers did not realize the emergence of ERC777 at the beginning. The explosion of the Apollo 13 oxygen tank was the same, but independently, the code of imBTC and Lendf, and the Apollo 13 oxygen tank and the heater switch were no problem.</p><p>The launch of Apollo 13 was the era of great leap forward in human space technology. In an age of reliance on extremely primitive computer equipment and even manual calculations, Americans spent all their national power, spent trillions of dollars, and developed thousands of space equipment And the system, and combine it into the Apollo series spacecraft and the Saturn V rocket carrying the spacecraft. With the technical level at that time, the Apollo project is a miracle.</p><p>But even if it is as strong as the United States, the Apollo plan can hardly avoid the disastrous results caused by the mismatch between the complexity exponential curve and the maturity linear curve. How can DeFi, which is dominated by community development forces, avoid the necessary development stage challenges?</p><p><strong>Part3: Tribute to the explorer</strong></p><p>We should not lose faith in DeFi for the accident of Lendf.ME or Maker. Just like after the failure of Apollo 13, NASA did not cancel the Apollo plan, nor did the Americans stop the pace of space exploration. After deep reflection, NASA launched many successful Apollo missions, and then built and launched the greater International Space Station.</p><p>The DeFi protocol is the spacecraft component that we fly to free space. The developers of the DeFi protocol play the role of spacecraft engineers, and the most important astronauts are assumed by DeFi users. All participants, whether developers or users, have played a great role, and regardless of the results, they deserve respect.</p><p>In addition to respect, we must immediately realize that the development of DeFi has entered a dangerous area. Developers should put down various prejudices and interests and work together to design and create a safer DeFi spacecraft, and be responsible for the users boarded on it.</p><p>After Lendf.ME was attacked, many DeFi developers and even some CeFi exchanges took the initiative to help Lendf.ME, but some Lendf.ME competitor project parties were not only unwilling to provide help, but also sneered Lendf.ME on twitter.</p><p>After the accident of Apollo 13 on that year, the entire United States was looking for ways to help the three astronauts. Even the enemies of the United States, Soviet Union, offered to help the United States. Compared with the Soviet Union, the behavior of Lendf.ME competitors is not only mean, but also unwise. Now the DeFi exploration has entered the deep water area. All project parties in the world, regardless of whether they have a competitive relationship, are actually on the same spaceship. Help should not be sarcasm. The last thing that hurts all users is their confidence in DeFi.</p><p>Onlookers who have not used DeFi need not sneer at DeFi developers and users because of frequent hacking attacks. Without the efforts and sacrifices of DeFi developers and users, how can safe and efficient open financial applications be used? What’s more, many of the current DeFi users are themselves DeFi developers, and the engineers themselves are sitting on the spaceship.</p><p>If future generations of our descendants reach farther than the moon, they will think of the three astronauts of Apollo 13: James A Lowell, Jack Swigter and Fred Hayes, As well as astronauts sacrificed on the Space Shuttle Challenger and Columbia.</p><p>In the future, if all human beings, including countries in the third world, have the opportunity to use various free and open DeFi services, they should also thank the DeFi users who have been damaged in the past hacking attacks, as well as everyone who tirelessly and never forget the original DeFi developers, this exciting journey will always begin with the first steps taken by these explorers and builders to pay tribute to them.<br><strong>Houston, Let’s go to da moon.</strong></p><p><em>Original source: </em><a href="https://www.chainnews.com/articles/305446519018.htm">https://www.chainnews.com/articles/305446519018.htm</a><em><br>Translator: Skyge<br>Proofreading: serebii</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a705f7b26e3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>