MYX Finance Rug Pull

Reported loss $120K
Rugpull

What happened

QMYX was an Ethereum token that borrowed the name of the MYX Finance derivatives protocol. Its _transfer function does not check the sender's stored balance; it asks a hidden external contract, set at deployment and not included in the verified source, how many tokens the sender holds. That contract can report zero for ordinary holders, so their sells revert, and an arbitrarily large number for a chosen address, which can then transfer tokens that were never minted.

On December 1, 2023 the address 0x76345889…02168d swapped 10 trillion QMYX, against a 150 million supply, into the Uniswap V2 pool for 57.18 WETH (about $119,888), taking the price to zero. The deployer was 0xc405BCbe…706fE7.

How it happened

  1. The constructor's totalSupply argument is not used as the supply. _mint adds it to a constant to build an address and stores it as the hidden contract x, then hard-codes the supply to 150 million: address p = address(z); x = XOL(p); amount = 150000000 * 10 ** 18;.
  2. Every transfer reads the sender's balance from that hidden contract instead of the _balances mapping: uint256 senderBalance = balanceoF(sender);, where balanceoF returns x.squirrel(true, bytes32(0), sender).
  3. The value that contract returns decides whether a transfer passes (require(senderBalance >= amount, ...)) and then overwrites the stored balance: _balances[sender] = senderBalance - amount;. The public balanceOf still shows the stored mapping, so wallets and explorers display normal holdings.
  4. Because the logic lives outside the verified source, the hidden contract can report any number for any address: zero for a buyer (the sell reverts with transfer amount exceeds balance) or a huge number for a chosen wallet.
  5. On December 1, 2023, 0x76345889…02168d called swapExactTokensForTokens on the Uniswap V2 router and sold 10,000 billion QMYX into the QMYX/WETH pair for 57.18 WETH (tx 0xc5529e30…e83190), which emptied the pool's WETH side.

Protocol details

Classification Token
Protocol Type Derivatives
Affected asset / contract QMYX
Protocol links Website @MYX_Finance

Security review history

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.