Spartan Protocol Hack
What happened
On May 2, 2021, an attacker exploited flawed liquidity-share accounting in Spartan Protocol's BNB Smart Chain liquidity pools. Using a PancakeSwap flash loan, the attacker manipulated pool balances, minted and burned LP tokens at an inflated redemption value, and drained more than $30 million in SPARTA, BNB, and related assets. The flash loan supplied temporary capital, but the root cause was a smart-contract liquidity-accounting error.
Spartan later patched the calculation and introduced a community compensation process; no full recovery of the attacker's proceeds was confirmed.
calcLiquidityShare() read manipulable current pool balances instead of cached accounting balances, allowing temporary balance inflation to inflate an LP redemption.
How it happened
- The pool used current token balances when calculating how much a burned LP position could redeem.
- An attacker temporarily inflated those balances with flash-loaned WBNB and carefully timed swaps and liquidity additions.
- The contract then treated the attacker's LP tokens as entitled to an outsized portion of the pool.
- Repeating this cycle drained real liquidity, after which the flash loan was repaid in the same transaction.
Protocol details
Security review history
- CertiK View report
- Code4rena View report
Evidence
Proof of concept
1 available- Code Spartan Logic Flaw
Sources
- report Post-mortem rekt.news
- report Report peckshield-94632.medium.com
- report @FrankResearcher incident report twitter.com
- analysis Spartan Protocol liquidity-pool exploit statement spartanprotocol.medium.com
- analysis DeFiLlama defillama.com
- analysis The Spartan Incident: Root Cause Analysis peckshield.medium.com
- analysis Binance Smart Chain's Spartan Protocol loses $30M in exploit coindesk.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.