Cointime

Download App
iOS & Android

DFX Finance Smart Contract Vulnerability Explained

Cointime Official

by Shashank

Overview:

On 11th November 2022, a Re-entrancy attack occurred, which resulted in draining a total of ~$7.5M from DFX Finance’s Polygon liquidity pools. The attacker could only transfer $4.3 million worth of assets into their wallet. The remaining portion–about $3.2 million– was extracted by an MEV bot in a front-running transaction, also called a sandwich attack.

Smart Contract Hack Overview:

  • Attacker’s address: 0x14c1
  • DFX Finance Code: 0x8888
  • MEV Bot Address & transaction: 0x6c6b
  • MEV Bot’s wallet address: 0xfde
  • Unconventional ordering transaction Block: 15941904
  • MEV Bot & wallet transaction address analysis: 0xfde0d

GitHub code link:

Decoding the Smart Contract Vulnerability:

Series of transactions connected to the wallet and MEV bot
DFX Finance Smart Contract Vulnerability
  • Because there was no outstanding amount at the attacker’s address, the transactions satisfied the validation when the transaction pair contract’s balance was checked, bypassing the necessity for transaction pair checks to pay back the flash loan. Link
  • The withdraw () function had a Re-entrancy protection modifier which could not be triggered since the flash loan was completed but the lptokens deposited by the attacker still existed in the lending contract, which actually belonged to the attacker, thus allowing an attacker to call the emergencyWithdraw() function any number of time until attacker withdraw all the deposited tokens.
  • Due to the MEV bots being activated, the attacker lost a significant amount of money to the owner of those bots and was only able to recover about $4M in stolen money.
Comments

All Comments

Recommended for you

  • BTC Surpasses $72,000

    Market data shows that BTC has broken through $72,000, currently trading at $72,007.52. It has seen a 24-hour increase of 1.24%. The market is experiencing significant volatility, so please implement risk control measures.

  • BlackRock Transfers 11,780 ETH and 634 BTC to Coinbase Prime Address

    According to data monitored by Arkham, approximately half an hour ago, BlackRock transferred a total of 11,780 ETH, valued at approximately $25.75 million, to a Coinbase Prime address through its Ethereum exchange-traded fund (ETF) ETHA. Additionally, approximately 634 BTC, valued at approximately $45.35 million, were transferred to a Coinbase Prime address through its Bitcoin ETF, IBIT.

  • US Republican Representative Calls for Trump's Removal Under 25th Amendment

    March 25th News, Market News: US Republican Representative Alexandria Ocasio-Cortez has formally called for the removal of President Trump under the 25th Amendment of the Constitution. (JIN10)

  • Iranian Navy: US Aircraft Carrier Will Become Target Once Within Missile Range

    On March 25, according to the Iranian SNN news agency, Iranian Navy Commander Irani stated that the US 'Lincoln' carrier strike group is under continuous surveillance by Iran, and once it enters the range of missile systems, it will become a target for strikes. (Jinshi)

  • US Spot Bitcoin ETF Sees Net Outflow of $66.71 Million Yesterday

    According to monitoring by Trader T, the US spot Bitcoin ETF experienced a net outflow of $66.71 million yesterday.

  • BTC Surpasses $70,000

    Market data shows that BTC has broken through $70,000, currently trading at $70,011.9. The 24-hour decline has narrowed to 1.11%. The market is experiencing significant volatility, so please implement risk control measures.

  • BTC Drops Below $69,500

    Market data shows that BTC has fallen below $69,500, currently trading at $69,492.81. It has experienced a 2.2% decline in the past 24 hours. The market is experiencing significant volatility, so please implement risk control measures.

  • CLARITY Act Draft: Ban on Stablecoin Yields for Holding Only

    On March 24, according to CoinDesk, cryptocurrency industry practitioners on Monday saw the latest provisions regarding stablecoin yields in the revised version of the Senate's "Digital Asset Market Clarity Act" for the first time during a closed-door review meeting on Capitol Hill in Washington. The initial impression was that the relevant language was too narrow and lacked clarity. This new provision was released last Friday by Senators Angela Alsobrooks and Thom Tillis. According to a person familiar with the current draft, the new provision will prohibit earning yields solely from holding stablecoins, while restricting any practices that equate such programs with bank deposits, and imposing further limitations on other potentially permissible activities. The specific mechanism for determining activity-based stablecoin rewards remains unclear. This compromise stems from the lobbying battle between the crypto and banking industries. The banking industry insists that stablecoin rewards should not resemble interest-bearing bank deposits, arguing that such competing products could harm the banking sector and stifle lending. The final compromise allows for reward programs based on user stablecoin activities but prohibits balance-based rewards. This closed-door review aims to push the Senate Banking Committee to schedule a hearing, a significant step for the bill towards a full Senate vote. Similar versions of the "Clarity Act" have passed the House of Representatives in previous years, and another version has also passed the Senate Agriculture Committee's markup process. The bill's progress still faces other obstacles: all parties still need to reach an agreement on the DeFi regulatory framework, and Democrats are simultaneously insisting on including provisions that prohibit senior government officials from seeking personal gain from the cryptocurrency industry, a clause clearly targeting President Trump. (Dongxin News Agency)

  • Iran's IRGC: All Vessels Must Coordinate Passage Through Strait

    According to Al Jazeera: The Iranian Revolutionary Guard Corps (IRGC) Navy stated that the container ship 'Celine' was forced to leave the area because it did not possess a permit to pass through the Strait of Hormuz. The IRGC Navy further stated that any vessel transiting the Strait of Hormuz must coordinate fully with Iranian maritime authorities. (Jins10)

  • Circle Shares Plunge Over 16%, Hitting Largest Single-Day Drop Since June 2025

    Circle (CRCL) shares fell by more than 16% intraday, marking the largest single-day decline since June 2025. The stock is currently trading at $106.1.