PolyDEX Hack

Reported loss $511K
Polygon
Other

What happened

The attacker's address:

Address 0x8a0a…7c6c

The transaction behind the attack:

Tx 0x6b3f…e3a2

The attacker performed the re-entrance attack on the Token Locker smart contract. The contract itself does not have an issue with standard ERC20, but since the PLX token is ERC777 standard, there will be tokenReceived() callback event every time method transfer() triggered. The attacking smart contract deployed by the hacker has included the unlockAll() trigger repeatedly (40 times) in the event, so he was able to unlock more than the amount he locked in before.

The attacker:

  • Locked 15,711,384 PLX in the Locker, received 15,711,384 fPLX
  • Unlocked all 15,711,384 fPLX from the Locker, received 1,184,289 PLX
  • In the tokenReceived() called unlockAll() function
  • Repeated previous step 40 times.

Stolen tokens were sold on USDC, which then were bridged on Ethereum:

Tx 0xe021…d1ad

Protocol details

Classification Exchange (DEX) / Reentrancy
Protocol Type DEX
Affected asset / contract PLX
Implementation language Solidity
Protocol links Website @PolyDexFi

Security review history

Understand the attack patterns

Build your security review skills

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