Wooppv2 contract project on the Arbitrum chain is attacked and analyzed

Source: Beosin

Late at night on March 5, 2024, Beijing time, according to the Beosin Trace platform, the WoopPV2 contract project on the Arbitrum chain was attacked by price control, causing a loss of about $ 8.5 million.Hackers use Lightning Loan to borrow USDC.E and WOO tokens, and then frequently exchange tokens via WOOPPV2 contracts.Due to the defects of the price calculation of the WOPPV2 contract, hackers can control the price during the exchange process, causing a large number of WOO tokens to be stolen.The Beosin security team analyzed the incident as soon as possible.

Vulnerability analysis

There is a SWAP function in the wooppv2 contract,The user can call this function for token exchanges. This is mainly the exchange between USDC.E and WOO (the following is analyzed according to the exchange between USDC.E and WOO), where the quotetoken variable in the function represents USDC.e.

The _Sellquote function is similar to the logic of the _Sellbase function. They are calculated to the number of tokens redeemed according to the price, and then send the token to the caller._Sellquote is a function called when the caller uses USDC.E to exchange WOO token. The main functions are state and _CalcbaseAmountSellquote. State is a structure used to return to save WOO prices. Calculate quantity and new priceFunction.

Next, let’s look at the logic of _calcbaseamountSellquote function. The Baseamount is the calculated amount of exchange. The main logic is the number of USDC.E except for the price of WOO. The number of WOOs can be exchanged.New price after exchanges.

The _SellBase function is the same as the _Sellquote function, but the _calcquoteamountSellBase function is slightly different. The main logic is that the number of WOO is multiplied by the price of WOO, and the number of USDC.E can be exchanged.

According to the logic of exchange, we can find a problem,The calculation logic of this exchange quantity is different from the traditional SWAP multiplication model of traditional SWAP such as UNISWAP. This mode is directly calculated according to the price multiplication to make the exchange process does not have a slippery point, but the price will change with the exchange.If the caller is carefully calculated, the token inside can be taken out.

For example:

If there are 1,000 A tokens and 1,000 B -tokens in the pool, the price of B tokens is 1.Then if you use 500 A tokens, you can exchange 500 B tokens. At this time, the pool becomes 1500: 500, and the price of B tokens will rise, such as becoming 2.Next, using the 500 B -tokes exchanged for the exchanges will be exchanged for 1,000 A tokens, and finally the pool becomes 500: 1000 and sets out 500A tokens out of thin air.

In this incident, the attacker used the security problem. Let’s take a look at how the attacker was attacked.

Attack process

This incident attacker attacked through many same methods. Here

0xe80A16678B5008D5BE1484EC6EC6E77DC6307632030553405863FFB38C1F94266 is an example.

1. The attacker borrowed more than 10 million USDC.E and 2.72 million WOO tokens through Lightning Loan.

2. Next, the attacker uses 100,000 USDC.E to exchange WOO token in three times. At this time, you can see that the price of WOO is still at normal price. The attacker currently holds more than 8 million WOOs.

3. Then, the attacker directly used more than 8 million WOO tokens to exchange USDC.E. Due to the above problems, more than 8 million WOOs were redeemed at the normal price at this time, and more than 2,000 USDC.E, and calculated that the price of WOO at this time was 7, which reduced nearly 10 million times.

4. Finally, because the price of WOO tokens is very small, the attacking attacker uses a very small USDC.E to convert more than 8 million WOO tokens, and finally returned Lightning Loan to leave.

Fund tracking

After the hacking attack, the attacker transferred 200 ETH to the address on the Ethereum chain through the cross -chain bridge, and the remaining 2,000 ETH was stored on the address of the Arbitrum chain. The funds were not moved as of the time of press time.

In view of the price control attack incident on the Arbitrum chain, we must recognize the importance of security risks in the field of virtual assets.

  • Related Posts

    Binance launches Alpha points, understand all the rules

    Jessy, bitchain vision The requirements for participating in Binance Wallet TGE are getting higher and higher! Previously, the popularity of Binance Wallet’s exclusive TGE brought a large amount of data…

    Bankless: What are the decentralized content creation platforms worth paying attention to?

    Author: William M. Peaster, Bankless; compiled by: Tao Zhu, Bitchain Vision I have been writing in the field of crypto since 2017.Since then, I have turned writing into a career…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    Conversation Vitalik Buterin: Fusaka upgrade is planned in the second half of the year

    • By jakiro
    • April 28, 2025
    • 6 views
    Conversation Vitalik Buterin: Fusaka upgrade is planned in the second half of the year

    Three reasons why Ethereum is in trouble

    • By jakiro
    • April 28, 2025
    • 13 views
    Three reasons why Ethereum is in trouble

    Can altcoin ETFs avoid the fate of Ethereum ETFs?

    • By jakiro
    • April 27, 2025
    • 13 views
    Can altcoin ETFs avoid the fate of Ethereum ETFs?

    a16z: Stablecoin Guide

    • By jakiro
    • April 27, 2025
    • 15 views
    a16z: Stablecoin Guide

    What is a reciprocal tariff?How does it affect the crypto industry?

    • By jakiro
    • April 27, 2025
    • 22 views
    What is a reciprocal tariff?How does it affect the crypto industry?

    Web3 Entertainment New Era: How Short Shows Unlock Personal Influence Growth Password

    • By jakiro
    • April 26, 2025
    • 32 views
    Web3 Entertainment New Era: How Short Shows Unlock Personal Influence Growth Password
    Home
    News
    School
    Search