UN Token Hack

Reported loss $27K
Flash Loan Attack

What happened

UN, a BEP-20 token on BNB Smart Chain, was exploited with a flash loan on June 6, 2023. MetaTrust put the loss at about $26,000; the figure shown here is $26,558. CertiK attributed the exploit to a flawed burning mechanism in the UN token contract.

The attacker borrowed 29,100 BSC-USD from a DODO pool, bought UN from the UN/BSC-USD pair, and then repeatedly sent UN to the pair and called skim() to take the excess back. Because of the flaw in UN's token logic, these rounds reduced the UN held by the pair and pushed the UN price up. The attacker then sold its UN back into the pair for more BSC-USD than it had borrowed, repaid the loan and kept the difference. With the $29,100 loan repaid, the $26,558 profit implies roughly $55,658 of BSC-USD taken from the pair.

**Block data**

  • Attacker: 0xf84efa8a9f7e68855cf17eaac9c2f97a9d131366
  • Attack contract: 0x98e241bd3be918e0d927af81b430be00d86b04f9
  • Exploit transaction: 0xff5515268d53df41d407036f547b206e288b226989da496fda367bfeb31c5b8b

How it happened

  1. The attack contract borrowed 29,100 BSC-USD in a flash loan from the DODO DPPOracle pool 0xFeAFe253802b77456B4627F8c2306a9CeBb5d681.
  2. It swapped all of the BSC-USD for UN in the UN/BSC-USD pair.
  3. It sent 93% of its UN to the pair and called skim(), then repeated with 90% and then 80% of its remaining balance. The flawed burn logic in UN meant each round cut the pair's UN balance, raising the UN price in the pair.
  4. It swapped its remaining UN back to BSC-USD at the inflated price.
  5. It repaid the 29,100 BSC-USD flash loan and kept about $26K.

Protocol details

Classification Token
Protocol Type Exploit/Flash Loan Attack
Affected asset / contract UN

Understand the attack patterns

Build your security review skills

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