Multiple Binance Smart Chain projects have run away, PopcornSwap has taken away 40,000 BNB. What is the solution to the "embarrassment" of the exchange's public chain?

Multiple Binance Smart Chain projects have run away, PopcornSwap has taken away 40,000 BNB. What is the solution to the "embarrassment" of the exchange's public chain?

Wu said author | Colin Wu

Editor of this issue | Colin Wu

Recently, several liquidity "miners" told Wu Blockchain that another DeFi "earth mine" popcornswap on Binance Smart Chain ran away, and the project owner took away nearly 48,000 BNB, worth about 2.15 million US dollars. Three more projects (Zap Finance, Tin Finance, and SharkYield) ran away within a few days. Currently, SharkYield is suspected of taking away 6,000 BNB.

Binance said that the security team is "following up overnight" on the PopcornSwap project, but it is not certain that the funds will be recovered successfully. Binance's previous promotional articles also stated that recovery is a low-probability event, and users are encouraged to invest cautiously and choose high-quality head projects to participate.

There are two problems with this popcornswap runaway incident:

1. According to feedback from miners, Binance stated that USDT (through Tether) and BUSD can be frozen, but BNB cannot be frozen, so the runaway projects began to use BNB on a large scale.

2. Binance once said that in the future, the Binance Smart Chain community will provide audit services for high-quality projects deployed, and there will be a mark to distinguish between audited and unaudited projects for user reference. However, until now, the audit mark has not appeared, which may be an obstacle to the high cost and time of the audit agency.

Binance’s previous response was that BSC is a public chain like Ethereum and should not be held responsible for the projects on it. He Yi once said: The Binance Smart Chain project was not launched by Binance, so why didn’t they seek compensation from Vitalik Buterin for the losses from mining on Ethereum?

But on the other hand, Binance is promoting helping users recover their assets. For example, when Wine Swap, an automated market maker (AMM) "earth mining" project, ran away, the Binance security team helped users recover 99.9% of the lost funds, totaling more than $344,000. Binance also said that such a pursuit often requires a lot of manpower and material resources, and often these tracing clues will be interrupted, and it is rare to be able to recover successfully like this time.

As a result, Binance will fall into an awkward situation: should it manage the aborted projects or not? Users will also have questions about this, whether Binance will manage them or not?

The logic of projects on BSC is that CZ will retweet a well-developed project, which will then attract attention and gradually grow. In contrast, Huobi Ecosystem is more centralized, lists registered projects, and has fewer cases of running away. Binance Smart Chain hopes to "not be a referee."

This is understandable. Binance Smart Chain is more internationalized. For overseas users who are accustomed to the DAO community culture, they may be more able to understand BSC's approach. Overseas communities are very wary of centralized management, so Binance's easy freezing of BNB assets may also cause concerns for overseas users. Even if it is a freeze for hacking, it requires a request from the police first.

Since the majority of Huobi's projects and users are Chinese, they must choose centralized management and control. It is said that Huobi has a detailed emergency plan for runaway projects, and several small projects were also dealt with as soon as possible.

For Binance, the situation of running away on BSC is indeed becoming more and more serious, and relying on institutional governance may be the only option. But so far, we have not seen any improvement in the Binance Smart Chain system.

Refer to the ambition and embarrassment of Binance Smart Chain (BSC): Surpass Ethereum or become Justin Sun?

The following content is exclusively authorized by iNexusPro to be published by Wu Shuo Blockchain and has been slightly edited

Generally speaking, there are several steps to withdraw funds from soil mines:

1. Use high APY to attract you to go all-in impulsively (note that many sneaky mines only write APR, which looks higher. Mines with APR can be closed directly for safety). After all, high APY is supported by real money. With such high returns, big investors would have come long ago. As the saying goes, the higher the return, the greater the risk.

2. Use some “so-called” security measures (timelock, etc.) to make you feel that the risk is very low.

3. After stealing the funds, they immediately exchange them for non-ERC tokens or tokens that cannot be frozen, and then wait for the opportunity to mix the coins and escape.

After seeing this step, you should understand that if you can do:

1. Do not touch any closed-source mining site, no matter how attractive the APY is.

2. If you want to participate in open-source soil mining, you must participate with a small amount of funds after checking the variable parameters in the diff contract. (However, there may still be risks, such as popcornswap, which will be explained in detail)

3. Then I believe you can avoid most of the risks. Let me briefly talk about how to diff contracts, how to check parameters, and some derivative thoughts.

Step 1: diff

Here we take the online comparison tool https://www.diffchecker.com/ as an example

Please note that the diff contract needs to be the contract address you actually want to transfer coins to (you can transfer a very small amount to get the address)

First, get the original MasterChef code (here we take pancakeswap as an example):

https://bscscan.com/address/0x73feaa1ee314f8c655e354234017be2193c9e24e#code

Next, let’s take popcornswap as an example:

https://bscscan.com/address/0x584527ded17aceb3dc617c40b04e8fe9afc57096#code

Copy the code to both sides and start diffing

Here I saved the diff results, you can click this link directly: https://www.diffchecker.com/VqaCP3DK

Changes to the string (name, etc.) in the result, or the content after // (comments) can be ignored.

As shown in the figure above, you can ignore

If the code is added by the original version and deleted by Tugou, it is generally not important. The key is the differences between Tugou and the original code:

The above picture shows the key differences. Tugou modified the original migrator method and added a function called preUpgrade.

After reading this, if you know nothing about the contract, you can just close the page to be safe.

Here is a brief analysis of the differences. First, the migrate method, this is the code inherited from sushiswap. The original code has the possibility of draining the money in the pool (so if Tugou has a migrate method, don’t play it if you want to be safe).

Here, the new preUpgrade method is public, which means that everyone can call it. This is a very suspicious point. In theory, when the migrator is set to a malicious address, the migrator can drain all the money.

Step 2: Check the variables

Click this button of the Tugou contract:

Check the variables such as migrator and owner: ( owner is the core )

It can be seen that the migrator is 0 and the owner is a timelock address. One of the tricks used by local scammers is to claim that they have a timelock and give the contract address, but the owner is not the timelock address. This is obviously a scam.

Of course, the timelock contract can also make small moves, so a diff operation is also required. There is no problem with its timelock here, so I will not go into details.

After completing the above two steps, many experienced miners may think that there is a timelock, but there is no problem with the contract variables. Although there are risks in the code, there is a timelock, so it’s okay. For low-level miners, it may be risk-free. Unfortunately, popcornswap is a slightly more advanced miner. See my analysis of the coin theft process below:

The project party calls:

https://bscscan.com/tx/0x38f75296e3343228c0309f8c99a24ca4f4812372f2b032f38ce25ac5a992b768

preUpgrade method, so that your address has the transferFrom permission of the token in the contract (simply understand that before the uniswap transaction, you need to allow the contract to spend your coins, here is to allow yourself to spend the coins in the contract)

Looking at the previous code, we can see that preUpgrade does have this function, but it only gives this permission to migrator, and migrator is 0. Modifying migrator requires a time lock, so how does it do it? (This question actually bothered me for a while)

The answer is: after deploying the contract and before adding the timelock, the project party changed the migrator to its own address, obtained the allowance of all tokens in it in advance through preUpgrade, and then changed it back to migrator and added a timelock.

Because these txs are mixed in with the txs added by the project party to the pool, it is impossible for ordinary people to check every tx before a pool, so popcornswap was able to steal 2mil tokens within 2 hours.

This method of committing the crime also made me think. At present, there is no effective tool to find out whether a contract address has tokens allowed to other addresses, so it is very difficult to find the problem. Ordinary users are not capable of and are unlikely to find this clue. I even believe that in this incident, some veteran miners who are familiar with the contract code also overturned.

Subsequent Thoughts

After this modus operandi was exposed, I believe that in the future, it is very likely that underground mines will use similar methods to steal coins, which is hard for ordinary users to guard against. In fact, in the past two days, two mines on BSC have failed, and the amounts stolen are not small.

As a public chain of exchanges, whether it is BSC or HECO, what is their core competitiveness? Is it decentralization?

I personally think not.

BSC, HECO, etc., their biggest advantages should be 1. Low transaction fees 2. Endorsement by the credibility of the exchange.

Take BSC as an example. As a public chain with a design similar to DPos, the cross-chain bridge is not decentralized, and most of the assets on it are issued by Binance. Even if the code is open source, how can it be decentralized?

Personally, I think that the opposite should be done. Introducing an arbitration mechanism similar to EOS to maximize the security of users’ on-chain property is the way to survive.

<<:  Unboxing the Mining Machine | If you can’t buy a Bitcoin and Ethereum mining machine, can you buy this?

>>:  XRP's 24-hour maximum increase reached 40.26%

Recommend

Bearish or bullish? These four key Bitcoin price indicators tell you the answer

This article is a translation. Its content is int...

Is Sun Li's face becoming more and more fierce?

Is Sun Li's face becoming more and more fierc...

Analyzing the goldfish eyes to see whether your fate is good or bad

Analyzing the goldfish eyes to see whether your f...

A woman with a mole on her collarbone is a "heartthrob"

Is it good for a woman to have a mole on her coll...

Looks scary but kind-hearted

It is said that appearance reflects the heart, wh...

Research: Some old malware has been redesigned to steal digital currency

According to btcmanager, Fortinet and Kaspersky r...

Is it good to remove the mole on the face? What does the mole on the face mean?

The face is a very obvious place. If there is som...

Who should beware of bad luck in love according to face reading

Who should beware of bad luck in love according t...

What are the facial features of a woman who will definitely marry a rich man?

In marriage, all women want to marry a rich man, ...

What does the unpredictable line in palmistry mean?

What does the unpredictable line in palmistry mea...

What does the marriage line in palmistry mean?

How to know marriage and relationship by reading ...

Analysis of the location and meaning of moles on the lower legs

Traditional physiognomy covers a wide range, among...