Treasure Swap Hack

TOTAL LOST $1.1M
Medium Other

Summarize with AI

Affected Chain 2022 Incident surface
Recovered - No recovery reported
All-Time Rank #815 By amount stolen
Protocol Type Exploit/Other Target category

Incident Overview

The Treasure Swap project has been exploited by hackers. Using the vulnerability, the hacker needed only 1 wei to exchange all the $WETH tokens in the transaction pool.

Treasure Swap is a donation protocol driven by the community to build a sustainable DAO.

The hacker noticed a vulnerability in the Treasure Swap contract, where in the swap function the check for the k-value of the constant formula k = a * b, which determines the price of the token (A) in the token (B), was skipped. The hacker noticed this vulnerability, deployed his malicious contracts on the network with which he began to steal the $WETH reserves from the protocol.

Example transactions of the exploit:

1) https://bscscan.com/tx/0x13285cc0…eba0c3

2) https://bscscan.com/tx/0x90a8e176…80c92d

3) https://bscscan.com/tx/0x0b13710a…fc219c

All stolen $BNB are still held on the hacker's wallet.

Hacker address: https://bscscan.com/address/0x0FaCB17e…b5931D

Vulnerable contract addresses:

1) https://bscscan.com/address/0xe26e4360…560f88

2) https://bscscan.com/address/0x96f6eb30…a65ec9

Malicious contract addresses:

1) https://bscscan.com/address/0xd53826f2…651fba

2) https://bscscan.com/address/0x5baa2e6b…dce376

3) https://bscscan.com/address/0xd14c71b8…3c2016

Incident Report

Protocol / Project Treasure Swap
Date of Incident
Attack Technique Other
Classification Exchange (DEX)
Primary Source View Post-Mortem

Protocol Information

Protocol Type Exploit/Other
Official Website treasureswap.net/
Protocol Twitter/X @treasure__swap
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
AI & Big Data Collectibles & NFTs Gaming Ethereum Ecosystem Layer 2 Metaverse Arbitrum Ecosystem AI Agent Launchpad

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Treasure Swap's contract logic - root cause: exchange (dex)
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Likely — with a thorough Other audit checklist and test coverage

If you're auditing a protocol with similar architecture to Treasure Swap, these are the critical security checks that could have prevented this incident (June 2022).

  • Verify all logic paths related to Other are guarded by proper access controls and input validation
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Sources & References

Learn to Prevent the Next Treasure Swap

The Treasure Swap hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial