The recent attack on the LULA token on the BNB Smart Chain is a stark example of how vulnerabilities in smart contracts can lead to significant financial losses without affecting the exchange's infrastructure itself. The attacker managed to drain the equivalent of $578,000 from a liquidity pool on the decentralized exchange PancakeSwap. The entire operation was carried out without a single hack of the DEX.
Key Vulnerability: The recycle() Function
At the core of the attack was the recycle() function embedded in the LULA token's code. It granted the Rental contract two critical permissions:
- To withdraw LULA tokens directly from the PancakeSwap V2 pair.
- To call the sync() function, which forcibly synchronizes the pool's accounting reserves with its actual, already altered balances.
Imagine a liquidity pool as a scale: on one side is USDT, on the other is LULA. The price is determined by their ratio. A regular trader can only move coins from one side to the other through swaps. The recycle() function allowed removing tokens from one side, while sync() forced the scale to recognize the new, distorted position as fair.
Reserve Manipulation Scheme
The sequence of actions, as described by analysts at BlockSec Phalcon, is as follows:
- Large USDT to LULA swap: As a first step, the hacker significantly increased and inflated the USDT reserve in the pair.
- Multiple recycle() calls: Using the obtained permissions, the attacker began reducing the LULA reserve by withdrawing tokens from the pool.
- Small reverse LULA swap: After artificially compressing the volume of LULA on the "scale pan," the hacker exchanged a small number of tokens at a fictitiously inflated rate, thereby draining the remaining liquidity from the pool.
The fewer tokens remain on one side, the more expensive each one becomes. By artificially compressing the volume of LULA, the attacker exchanged a small number of tokens at a fictitiously inflated rate, pulling almost all funds out of the pool.
Preparation and Execution
The attack was not spontaneous. 12 days before the exploit, the hacker deployed auxiliary contracts to accumulate referral and team rewards. The claimReward() → recycle() chain allowed maximizing the deflationary effect — compressing the number of tokens in circulation.
For the main phase, a flash loan of approximately $237 million was used. This tool works like money borrowed for a few seconds on "good faith": the borrower must repay the amount within the same transaction, otherwise it is reversed. No personal capital is needed, so flash loans are often used to amplify price manipulation. The borrowed funds were used to withdraw LULA from the DEX pool, enhancing the effect of the recycle() calls.
Cryptalist Analysis: This case is not just another hack, but a brilliant, albeit criminal, example of how tokenomics can be used against itself. Developers need to thoroughly audit not only the swap logic but also any functions that can affect liquidity pool balances. For investors, this is another reminder: "inflated" liquidity and low market capitalization are an ideal environment for such manipulations.