Treasure Swap Hack
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 Information
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.
What Auditors Should Check
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 TrialSources & References
-
01
Source 1 https://treasureswap.net/
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.